I have a file [ Name Age Marks] . I have stored each values of Name in a list1 . Marks in list2. I have combined both lists using zip function in python:
list3 =[]
list3 = zip(list1,list2)
Eg: list3 = ((Steve,32),(David,65),(Ram,43),(Mary,87)) Now I want to sort list3 in descending order of marks. So kindly help how to proceed with this. I am new to python. Thanks for your time and consideration. Awaiting response
list1, why notnames? And instead oflist2, why notmarks?list3 =[]before assigning it tozip, by the way. I'm guessing you're doing it in order to "declare" thatlist3is a list. But in Python, variables do not need declaration; you could have donelist3 = 2342instead, and everything would still work the same way. So you may as well not put anything beforelist3 = zip(...