title: print average percentage of a student from an array
body: <p>The program is supposed to calculate and print out a given student's average percentage.</p>
  
  <p>Unfortunately I am only able to print out the average percentage of the last student name in the array. 
  I want to know where exacltly I am going wrong with my coding.
  Thanks. Heres my code below.</p>
  
  <pre><code>def averagepercentage():
  
      scores = int(name_marks[1]),int(name_marks[2]),int(name_marks[3])
      ap = sum(scores)/3
  
      return ap
  
  N = int(input('Number of students: ')) # total number of students
  marks = int()
  arr = []
  
  for i in range(N):
      name_marks = input('name &amp; marks').split() #enter name &amp; three different scores 
      name = str(name_marks[0])
      arr.append(name)
      print(arr)
  
  student_name = str(input('student_name'))
  for x in arr:
      if student_name in x:
  
          print (x)
  
          print("%.2f" %averagepercentage())
  </code></pre>