Day 1_敘述(Statement)
1-1. print
式子:
a = 10
print(a)
結果:
10
1-2. if
式子:
a = 1
if a == 1:
print('a = 1')
結果:
a=1
1-3. for
式子:
for x in [1, 2, 3, 4, 5]:
x = x * 2
print('x =', x)
結果:
x = 2
x = 4
x = 6
x = 8
x = 10
1-4. while
式子:
i = 0
while i < 3:
print('Simple')
i = i + 1
結果:
Simple
Simple
Simple