Python 入門指南 5.0
exercise0610.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 | # 使用者輸入分數
score = int(input("請輸入分數:"))
# 依分數印出評語
match score:
case 100:
print("Perfect!")
case 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99:
print("Excellent!")
case 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89:
print("Great!")
case 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79:
print("Good!")
case 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69:
print("Not Bad!")
case s if s < 60:
print("Bad!")
case _:
print("That's impossible!!")
# 檔名: exercise0610.py
# 說明:《Python入門指南》的練習
# 網站: http://kaiching.org
# 作者: 張凱慶
# 時間: 2023 年 8 月
|