Untitled
Anonymous
plain_text
03/27/2024 5:07 PM
536 B
21
Indexable
input_scores = input("請輸入成績,用空格分隔每一科: ").split()
scores = []
for input_score in input_scores:
scores.append(int(input_score))
for score in scores:
print(f"已加入 {score}")
total_scores = sum(scores)
average_score = total_scores / len(scores)
print("謝謝填寫")
print(f"您共輸入了{len(scores)}科的成績,您的平均成績為{average_score:.1f}")Editor is loading...
Leave a Comment