Day 3_縮排(Indentation)
3-1. 沒有縮排時會出現錯誤
式子:
for x in [1, 2, 3]:
x = x 2
print('x =', x)
應改成:
for x in [1, 2, 3]:
x = x 2
print('x =', x)
結果:
9
3-2. if敘述未縮排會出現錯誤
式子:
a = 25
b = 100
if b > a :
print('b比a大')
應改成:
a = 25
b = 100
if b > a :
print('b比a大')
結果:
b比a大