Lecture 88 - Python(8) 파이썬을 이용한 우편번호 검색기, nCloud에 python 3 설치
파이선을 활용한 우편번호 검색기 - 강사님 Version ZipSearch.migrationEx01 file = open('zipcode_seoul_utf8_type2.csv', 'r', encoding='utf8') line = file.readline() while line: lines = line.split(',') # statement처럼 print("insert into zipcode values(%s, '%s', '%s', '%s', '%s', '%s', '%s')" %\ (lines[6], lines[0], lines[1], lines[2], lines[3], lines[4], lines[5])) line = file.readline() file.close() ncloud mariadb에서 ..
2019. 8. 1.
Lecture 82 - Python(3) 제어문, 조건문, 비교문, if, else, while, for, continue, range, 함수의 구조, 매개변수와 인수, kwargs, return, lambda
제어문 if문 자바와 다르게 {}가 없고 탭과 스페이스로 라인을 맞추어 주어야 에러가 안생긴다. "돈이 있으면 택시를 타고, 돈이 없으면 걸어 간다"를 작성해 보자 Ex01.if01 money = 1 if money: print('택시 타고 가라') else: print('걸어 가라') print('끝') money = 1 if money: print('택시 타고 가라') else: print('걸어 가라') print('끝') 위와 같이 줄 간격을 안맞추고 삐뚤빼뚤하게 하면 에러가 생긴다. if문의 기본 구조 들여쓰기 조건문 비교연산자 and, or, not &&, ||, != 이 아니라 and, or, not 문자 그대로 쓴다. money = 2000 card = 1 if money >= 3000 o..
2019. 7. 23.