# 01 Welcome
print("Welcome to Python!")
print("Welcome to \t\"Python\"!") #escape sequence
Welcome to Python! Welcome to "Python"!
# 02 변수(Variable)
my_variable = 10
# 03 자료형(Data Types)
my_int = 7
my_float = 1.23
my_bool = True
if my_bool:
print ('hello')
print ('hello')
hello hello
# 04 변수에 값 다시 할당하기
my_int = 7
my_int = 300
print(my_int)
300
# 05 공백(Whitespace)과 명령문(Statements)
def spam():
eggs = 12 # 에러가 발생합니다. 하지만, 그대로 진행하세요
return eggs
print(spam())
12
# 06 공백(Whitespace)
# 파이썬은 라인단위이며 들여쓰기로 구조를 표현
def spam():
eggs = 12
return eggs
print(spam())
12
# 07 인터프리터 (interpreter)
spam = True
eggs = False
eggs
False
# 08 한 줄 주석(Single Line Comments)
#learn fast
mysterious_variable = 42
# 09 여러 줄 주석(Multi-Line Comments)
"""
Oh these are all comments
"""
spam = True
# 10 수학 연산(Math Operations)
count_to = 1024 + 768
count_to
1792
# 11 거듭제곱(Exponentiation)
eggs = 10 ** 2
print(eggs)
100
# 12 나머지 연산자 (Modulo)
spam = 5 % 4
print (spam)
1
# 13 한 데 모아보기 Bringing It All Together
monty = True
python = 1.234
monty_python = python ** 2