728x90 반응형 SMALL 파이썬기초1 Python - 기본문법 # 쌍따옴표, 홑따옴표 차이는 없지만 홑따옴표를 기본으로 하자. print('hello world') # 따옴표 세 개 '''This is a multi-line string. This is the second line. "What's your name? ''' # 문자열 포맷팅 age = 20 name = 'yhkim' print('{0} was {1} years old when the wrote this book'.format(name, age)) # name + ' is ' str(age) + ' years old' 와 같이 작성하지 말고 format 을 이용하자. print('{0: .3f} , {1: .2f}'.format(1.0/3, 1/3)) print('{0:_^11}'.format('he.. 2018. 8. 27. 이전 1 다음 728x90 반응형 LIST