--- title: 10-2:分數等第 lang: zh-tw tags: DICE Python --- 10-2:分數等第 === > [name=Chinglin-K] --- 目錄:[Dice 程式教學-Python完整版](https://hackmd.io/@Chinglin-K/Dice-menu) 上一篇:[10-1:購票](https://hackmd.io/@Chinglin-K/Dice-10-1) 下一篇:[10-3:正三角形嗎?](https://hackmd.io/@Chinglin-K/Dice-10-3) --- ## 題目 寫一個程式讓使用者輸入分數,印出分數等級。 如 100 到 90 之間是等級 A,其餘類推如下: 89-80 B 79-70 C 69-60 D 59-0 F 輸入範例: 85 輸出範例: Your score is 85 and degree is B! --- ## 程式碼 ```Python= n = int(input()) if (n <= 100 and n >= 90): print(f"Your score is {n} and degree is A!") elif(n>=80): print(f"Your score is {n} and degree is B!") elif(n>=70): print(f"Your score is {n} and degree is C!") elif(n>=60): print(f"Your score is {n} and degree is D!") else: print(f"Your score is {n} and degree is F!") ``` --- ## 輸出 ```Python= ``` --- 目錄:[Dice 程式教學-Python完整版](https://hackmd.io/@Chinglin-K/Dice-menu) 上一篇:[10-1:購票](https://hackmd.io/@Chinglin-K/Dice-10-1) 下一篇:[10-3:正三角形嗎?](https://hackmd.io/@Chinglin-K/Dice-10-3) --- :::info 「盡多少本分,得多少本事」😊 ::: --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}