Zi 字媒體
2017-07-25T20:27:27+00:00
PYTHON機器學習自學/自修 整理[00011] ~ 語言技術:PYTHON GOSSIP(if判斷式)
語法
if 判斷式01:
判斷式01成立,執行語法
elif 判斷式N:
判斷式N成立,執行語法
else:
判斷不成立,執行語法
import sys
import decimal#精準度/精度 運算
intScore = int(input('輸入分數:'))
if intScore >= 90:
print('得 A')
print('得 甲')
elif intScore >= 80 and intScore < 90:
print('得 B')
print('得 乙')
elif intScore >= 70 & intScore < 80:
print('得 C')
print('得 丙')
elif intScore >= 60 & intScore < 70:
print('得 D')
print('得 丁')
else:
print('不及格')
print('得 戊')
寫了
5860316篇文章,獲得
23313次喜歡