問題概要
テストの点数に合わせて、Bad、Good、Great、Perfectの評価を出力せよ。
解法と実装
if文で場合分けして答えを出力できます。
N = int(input()) # 入力の受け取り
if N <= 59: # 59以下
print("Bad")
elif N <= 89:
print("Good")
elif N <= 99:
print("Great")
else:
print("Perfect")
不等号に等号をつけるかどうかで判定する値が変わるので注意してください。
N = int(input()) # 入力の受け取り
if N < 60: # 60未満
print("Bad")
elif N < 90:
print("Good")
elif N < 100:
print("Great")
else:
print("Perfect")