본문 바로가기

전체 글67

CSS - transition, ease Transition 스타일 전환 효과 설정. 설정 요소와 지속 시간을 설정한다. .redbox :nth-child(2) { height: 0; transition: height 0.5s ease; } .redbox:hover :nth-child(2) { height: 10vmin; } 위 코드는 redbox 클래스 2번째 요소의 높이를 0에서 10vmin으로 0.5초만에 변경 시키는 것. .redbox :nth-child(2) { height: 1px; transition: height 0.5s ease, width 1s; } .redbox:hover :nth-child(2) { height: 10vmin; width: 5vmin; } 높이와 넓이를 동시에 설정할 수도 있다. 전환 속도 설정 ease는 .. 2020. 1. 29.
Python requests 모듈 HTTP 요청 처리를 하기 위해 쓰는 모듈. 기본 내장 모듈이 아니라 따로 설치 해주어야 한다. 설치 하지 않으면, ModuleNotFoundError: No module named 'requests' 이런 에러가 발생함 커맨드 창에서 pip install requests 명령어 입력하여 설치. 2020. 1. 25.
Python 컬렉션 타입 List & Tupple List와 Tupple은 거의 동일. List - mutable ( 생성 후에도 변경 가능 ) Tupple - immutable ( 생성 후에는 변경 불가 ) a = [ 1, 2, 3, 4 ] #List #[1, 2, 3, 4] a = 'hello world' b = list(a) #['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] c = (1, 2, 3) #Tupple d = list(c) #[1, 2, 3] 다른 타입으로 부터 list 생성도 가능하다. str 과 list a = 'hello world' #a[0] = 'j' #TypeError: 'str' object does not support item assignment.. 2020. 1. 25.
Python 조건문, 반복문 조건문 if / elif / else 정수, 실수, 문자열 리스트 등 기본 타입도 조건에 사용 가능 False로 간주되는 값 (각 타입의 기본값) None 0 0.0 '' [] -> 빈 리스트 () -> 빈 튜플 {} -> 빈 딕셔너리 set() -> 빈 집합 a = [1, 2] if a: print(a) else: print('내용이 없습니다.') #[1, 2] 반복문 while 조건문: break //반복문 중단 continue //반복문 처음으로 돌아가기 for 변수 in 리스트( 튜플, 문자열 ): range(start, stop, step) 해당되는 범위 만큼 반복 객체를 만든다. a = range(1, 10, 3) #[1, 4, 7] for i in a: print(i) # 1 4 7 문자열 .. 2020. 1. 23.