def td():
choice = input("which trainning event would you like to access?\nswimming\ncycling\nrunning\n")
if choice == "swimming":
Swimming_file= open("Swimming_file.txt", "w")
totaldistance = input("what was the total distance you swam in meters?")
totaltime = input("how long did you swim for in minutes?")
total = (totaldistance, toataltime)
Swimming_file.write(str(total)
Swimming_file.close()
td()
它一直說swim_file.close()是一個synax錯誤,任何人都可以幫忙嗎?無效synax關閉文件
謝謝,daam不能相信我錯過了 – Kelly 2014-10-22 06:44:32