0

The question is to accept marks of a student in 3 assignment and make it a list. Then we need to create a new list such that it

the new list must contain the best two of three marks. ex.if the marks in my test are [40,60,90] then my new list =[60,90] I tried to code it but I couldn't get the output. can someone identify my mistake . l=[] n=int(input("enter the size of list :")) for i in range(n): l.append((input("enter the marks:"))) print(l) l.sort() m=[] for i in l: m.append(l[0:len(l)-1]) print(m)

23rd Nov 2018, 11:25 AM
Mara
2 Antworten
23rd Nov 2018, 11:45 AM
Dlite
Dlite - avatar
0
thank you
23rd Nov 2018, 11:58 AM
Mara