title: How can I sort my list by name/age separately?
body: <p>Additionally, if I wanted to sort them by their age, how could I do so?
  I tried myFile.sort(), but it crashes the code saying
  "Object has no attribute 'sort' "</p>
  
  <pre><code>fileName = "GuestList.csv"
  ACCESSMODE = "w"
  name = " "
  nbrGuest = " "
  
  myFile = open(fileName, ACCESSMODE)
  nbrGuest = input("How many guests do you have? ")
  for index in range (int(nbrGuest)) :
      name = input("Enter guest name: " ).capitalize()
      age = input("Enter guest age: " )
      myFile.write(name + "," + age  + "\n")
  myFile.close()
  </code></pre>