본문 바로가기

웹_프론트_백엔드/Python

(15)
2020.01.17 1. lex03_string.py # -*- coding: utf-8 -*- gdp_global = \ '''RankName2019 PopulationGDP (IMF)GDP (UN '16)GDP Per Capita 1UnitedStates329,064,91721,410,23018,624,475$65,064 2China1,433,783,68615,543,71011,218,281$10,841 3Japan126,860,3015,362,2204,936,212$42,269 4Germany83,517,0454,416,8003,477,796$52,885 5India1,366,417,7543,155,2302,259,642$2,309 6France65,129,7283,060,0702,465,454$46,984 7Unit..
2020.01.16 1. lex01_list.py # -*- coding: utf-8 -*- # 목표 : list기본함수: 생성, 추가, 삭제 : .insert(), .index(), append(), extend(), in # 1. 초기값 'Monday', 'Wednesday'을 갖는 list를 만들라. # 출력 : ['Monday', 'Wednesday'] # 2. list_week 맨앞에 'Sunday'를 추가하라. # 출력 :['Sunday', 'Monday', 'Wednesday'] # 3. list_week에 'Tuesday'를 'Wednesday'앞에 추가하라. # 출력 :['Sunday', 'Monday', 'Tuesday', 'Wednesday'] # 4. list_week 맨뒤에 'Thursday'와 Fr..
2020.01.15 1. lec07_format.py # -*- coding: utf-8 -*- # 목표 : text format 이해하기 # 설명 : 문자열 formatting 방법 2가지 # python 2.6 version. # python 3 version. # python 2.3 version : % 사용 # %d : 10진수 정수(decimal) # %o : 8진수 정수(octet) # %x : 16진수 정수(hexa decimal) # %f : 실수(float) # %c : 문자(character) # %s : 문자열(string) print('text = %s' % 'hello world') print('num = %d' % 1) print('실수 = %.2f' % 5.295612121) print('실수 =..
2020.01.14 1. lec02_var_data_type.py # -*- coding: utf-8 -*- #리터럴 literal (=상수, 값 그자체) #b는 변수, 1은 객체, b는 1이라는 객체를 가리키는 변수 b=1 #1이 리터럴임 #실수 #동적바인딩이되므로 값을 대입하는 순간 타입이 결정되며 여러가지 타입의 테이터를 저장할 수 있다 a=10.1 print(a, type(a)) print(type(10.1)) #문자열 a='hello' print(a, type(a)) print(type('hello')) #bool a=True print(a, type(a)) print(type(True)) 2. lec03_numeric_op.py # -*- coding: utf-8 -*- #산술연산, 자동형변환, 라인유지 #산술연..
2020.01.13 1. 개발환경 설치 1) python 3.7(3.8) 설치 : 구글에 pyton 검색 > Welcome to Python.org로 들어가서 다운 2) anaconda 설치(데이터 분석용 package 들이 포함되어 있음) : 구글에 anaconda 검색 > Anaconda | The World's Most Popular Data Science Platform 클릭 > 오른쪽 상단에 있는 다운로드 버튼 클릭 > Python 3.7 version 다운 2. 제대로 설치되었나 확인하기 1) python 3.7(3.8) 확인 : cmd 창에서 명령어 python -- version 하기 2) anaconda 확인 : 시작버튼으로 가서 anaconda가 있는지 확인 3. 파이썬의 특징 1) 인터프리터 언어 : 한..