Exercise 34 

 Given the list of student notes: notes = [12, 04, 14, 11, 18, 13, 07, 10, 05, 09, 15, 08, 14, 16]. Write a Python program that allows you to extract from this list another list that contains only the notes above the average ( notes > = 10 ).

Solution

notes = [12, 4, 14, 11, 18, 13, 7, 10, 5, 9, 15, 8, 14, 16]

# define list that will contains the notes above the averge
above = []
for x in notes:
if( x >= 10):
above.append(x)
print("The list that contains only the notes above the average is : ", above)

Younes Derfoufi

Leave a Reply