Pythonの制御構造とループ処理の活用
Pythonの条件分岐とネスト構造
Pythonでは、if、if-else、if-elif-elseの条件分岐構文が利用可能であり、これらをネストすることで複雑な条件判断を実現できます。
条件分岐のネスト例
score = int(input("点数を入力してください:"))
if score >= 80:
print("評価:優")
elif score >= 60:
if score >= 70:
print("評価:良")
else:
print( ...
7月27日 04:00 投稿