# 嘗試執行下方的程式碼並觀察結果
if 1 > 0:
print('king of the math')
if 2 > 3:
print('百年難得一見的數學奇才')
else:
print("這樣才對嘛~")
# IndentationError: expected an indented block
if 2 > 3:
print('百年難得一見的數學奇才') # if內容未縮排
# SyntaxError: invalid character in identifier
if 2 > 3: # 任何程式碼前無故空格
print('百年難得一見的數學奇才')
# SyntaxError: invalid character in identifier
if 2 > 3:
print('百年難得一見的數學奇才') # 縮排使用空白鍵而非Tab鍵
height = int(input("請輸入您的身高:"))
if height >= 190
print("可以打後衛")
if height >= 200:
print("可以打鋒衛")
if height >= 210:
print("可以打中鋒")
pokemon = input('請問你要選擇哪隻精靈?(妙蛙種子/傑尼龜)')
if pokemon == '妙蛙種子':
if 'Y' == input('請問你想要進化成妙蛙花嗎?(Y/N)'):
print('種子種子')
else:
print('草泥草尼')
else:
if 'Y' == input('請問你想要進化成水箭龜嗎?(Y/N)'):
print('傑尼杰尼')
else:
print('哭啊不給進化')
blood_type = input('請輸入您的血型:')
if blood_type == 'O' or blood_type == 'o':
print('據說這種血型的人都很幽默')
if blood_type == 'A' or blood_type == 'a':
print('據說這種血型的人都很聰明')
if blood_type == 'B' or blood_type == 'b':
print('據說這種血型的人都很勤勞')
if blood_type == 'AB' or blood_type == 'ab':
print('據說這種血型的人都很有錢')
if blood_type == 'RH' or blood_type == 'Rh' or blood_type == 'rh':
print('據說這種血型的人都很穩重')
blood_type = input('請輸入您的血型:')
if blood_type == 'O' or blood_type == 'o':
print('據說這種血型的人都很幽默')
elif blood_type == 'A' or blood_type == 'a':
print('據說這種血型的人都很聰明')
elif blood_type == 'B' or blood_type == 'b':
print('據說這種血型的人都很勤勞')
elif blood_type == 'AB' or blood_type == 'ab':
print('據說這種血型的人都很有錢')
elif blood_type == 'RH' or blood_type == 'Rh' or blood_type == 'rh':
print('據說這種血型的人都很穩重')
num = int(input('請輸入您的分數:'))
if num >= 90:
print("A")
elif num < 90 and num >= 80:
print("B")
elif num < 80 and num >= 70:
print("C")
elif num < 70 and num >= 60:
print("D")
else:
print("考試不努力明年當學弟")