일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 속초여행
- FLUTTER
- Django
- 강원도속초맛집
- DOM
- removetooltip
- 노마드코더
- 남양주맛집
- 성수동카페
- 건대입구맛집
- 컴퓨터과학
- pipenv
- python3
- 추상클래스
- popupmenubutton
- c언어문자열
- 코딩독학
- 알고리즘
- richtext
- 상속
- Python
- 자바
- 아스키코드
- 포인터
- 장고
- JavaScript
- 부스트코스
- BeautifulSoup
- 정렬알고리즘
- 가상환경
- Today
- Total
목록코딩독학 (14)
YUYANE
문제 www.hackerrank.com/challenges/introduction-to-regex/problem?h_r=internal-search Detect Floating Point Number | HackerRank Validate a floating point number using the regular expression module for Python. www.hackerrank.com 해결 코드 T = int(input()) nums = [] def detect(a): if '.' in a: idx = a.find('.') try: float(a) if len(a) > idx: value = a[idx+1] try: int(value) return True except: return Fal..
전체 코드 T = int(input()) nums = [] def detect(a): if '.' in a: idx = a.find('.') try: float(a) return a[idx+1] except: return False else: return False for i in range(T): num = input() nums.append(num) for i in range(len(nums)): print(detect(nums[i])) 필요한 값 입력 받은 값 a 는 string이다. 1) a가 '.'을 포함하는 지 확인한 후에 2) '.'을 포함 한다면, '.' 다음에 오는 문자를 출력하고 싶었다. 오류 내용 1) try 구문 안에서 float(a)까지는 ok 2) return a[idx+1] 에..
== , === 값을 비교할 때 사용되는 부호 == : 값을 비교 === : 값과 데이터 유형 모두를 비교 "2" == 2 // true "2" === 2 // false 5 !== "5" // true 5 != "5" //false
학습 강의 pocu-ko.teachable.com/courses/enrolled 예외(exception) 1) try-catch-finally문 try{ //시도할 코드들 } catch( ){ //예외가 발생할 경우 해당 예외를 처리할 코드 } catch( ){ //예외가 발생할 경우 해당 예외를 처리할 코드 } finally { //예외 발생 여부와 상관 없이 항상 실행 되는 코드 } - catch는 하나 이상 존재 가능 - finally는 생략 가능 2) catch와 예외 클래스 - IOException: 입출력과 관련된 예외 클래스들의 부모 클래스 - EOFException, FileNotFoundException, FileSystemException 등 - ArithmeticException: 산..
The String format() Method {}안에 들어가는 문자는 format 함수에 들어간 개체로 대체됨. >>> print('We are the {} who say "{}!"'.format('knights', 'Ni')) We are the knights who say "Ni!" {} 안에 들어가는 숫자는 format 함수에 들어있는 개체의 순서를 나타내기도 한다. print('{0} and {1}'.format('spam', 'eggs')) spam and eggs >>> print('{1} and {0}'.format('spam', 'eggs')) eggs and spam {} 안에 매개 변수가 사용되면, format 함수에서 해당 매개 변수의 값을 참고한다. >>> print('This ..
과제 결과 과정 div 가 만만했던 나는 div를 무진장 활용해서 만들었다.. .colors{ display: flex; flex-direction: row; justify-content: center; } .colors>div{ height: 320px; width: 200px; margin: 10px; } .colors>div:first-child{ background-color: #ef798a; } .colors>div:nth-child(2){ background-color: #f7a9a8; } .colors>div:nth-child(3){ background-color: #613f75; } .colors>div:nth-child(4){ background-color: #e5c3d1; } .colo..