
bass
這是當前的程式版本︰
highest_score = 0
result_f = open("results.txt")
for line in result_f:
if float(line) > highest_score:
highest_score = float(line)
result_f.close()
print("The highest score was:")
print(highest_score)
撰寫運用
split()
方法與多重指定的額外程式碼,建立名為
name
與
score
的變數,然
後使用它們完成尋找最高分數的程式。
rock_band
“Al Carl
Mike Brian"
ch04.indd 123 2011/8/6 上午 02:30:21