title: invalid synax for closing a file
body: <pre><code>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() 
  </code></pre>
  
  <p>it keeps saying swimming_file.close() is a synax error, can anyone help?</p>