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