title: How to use the functions of the students to order their averages?
body: <p>Here is the question:</p>
  
  <blockquote>
    <p>Use the program functions to get the name, surname and 4 marks for 5 students and finally print out the names of the students in order of their average.</p>
  </blockquote>
  
  <p>I wrote the functions, so I can get the averages of each student, but I do not know how to sort the name of the students.</p>
  
  <pre><code>_firstname = []
  _familiname = []
  _scores = []
  
  def student1():
      input('Please enter the firstname:')
      input('Please enter the familiname:')
      for i in range(0, 4):
          scores = int(input('Please enter the scores:'))
          _scores.append(scores)
      b = sum(_scores)
      avg1 = b/4
      print('avg is',avg1)
  
  def student2():
      input('Please enter the firstname:')
      input('Please enter the familiname:')
      for i in range(0, 4):
          scores = int(input('Please enter the scores:'))
          _scores.append(scores)
      b = sum(_scores)
      avg2 = b/4
      print('avg is',avg2)
  
  def student3():
      input('Please enter the firstname:')
      input('Please enter the familiname:')
      for i in range(0, 4):
          scores = int(input('Please enter the scores:'))
          _scores.append(scores)
      b = sum(_scores)
      avg3 = b/4
      print('avg is',avg3)
  
  def student4():
      input('Please enter the firstname:')
      input('Please enter the familiname:')
      for i in range(0, 4):
          scores = int(input('Please enter the scores:'))
          _scores.append(scores)
      b = sum(_scores)
      avg4 = b/4
      print('avg is',avg4)
  
  def student5():
      input('Please enter the firstname:')
      input('Please enter the familiname:')
      for i in range(0, 4):
          scores = int(input('Please enter the scores:'))
          _scores.append(scores)
      b = sum(_scores)
      avg5 = b/4
      print('avg is',avg5)
  
  student1()
  student2()
  student3()
  student4()
  student5()
  </code></pre>