title: I'm stuck with my python csv homework
body: <p>When I run the code the first time it works. When I run it a second time, it can't find the csv file until I replace it. I don't know why this is.</p>
  
  <p>I would also like to sort the times with the fastest at the top.</p>
  
  <pre><code>    def read_class_data():
      import csv
      driver=[]
      team=[]
      input_file = open("E:\Advanced Higher Computing\Racing.csv","r")
      data = csv.reader(input_file)
      print ("driver: ", driver)
      for eachline in data:
          driver.append(eachline[0])
          team.append(eachline[1])
      input_file.close()
      return driver, team
  
  def register():
      time=[]*6
      for i in range(6):
          temptime = float(input("What is your best time?"))
          while temptime &lt; 0:
              print("Time cannot be less than 0.")
              temptime = float(input("What is your best time?"))
          time.append(temptime)
      return time
  
  def write_class_data(dr, tm, time):
      import csv
      output_file = open("E:\Advanced Higher Computing\Racing.csv","w")
      data = csv.writer(output_file)
      for i in range(len(time)):
          data.writerow([dr[i], tm[i], time[i]])
      output_file.close()
  
  dr, tm = read_class_data()
  time = register()
  write_class_data(dr, tm, time)
  </code></pre>