Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information.
>>> 1+1 2
>>> a=1 >>> b=2 >>> a+b 3
>>> a*b 2 >>> a*b*b 4
>>> print('hello') hello
>>> print(1+2) 3
# 변수이름=저장값
>>> ses='만세!' >>> print(ses) 만세!
5. 조건문 if
>>> num=80 >>> if num > 50: ... print('pass') ... pass >>>
6. for문
for 변수 in 리스트 print (변수 리스트)
구구단 >>> for y in range(1,9): print (2,'x',y,'=',2*y)
2 x 1 = 2 2 x 2 = 4 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 2 x 6 = 12 2 x 7 = 14 2 x 8 = 16
7. while문
>>> num=0 >>> while num < 3: print('hi!!',num) num=num+1