Problems on Python Sorting
You can consult this post before attempting these questions
- Sort a Python list based on number of 0s in a numbered list.
a=[100,2,101]
sorted list =[2,101,100] - Sort a Python list of numbers based on odd or even. Odd numbers will come first.
a=[11,2,34,60,33,45]
sorted list=[11,33,45,2,34,60] - Sort a Python list of 3 number Tuples based on their sum.
a=[(1,2,3),(1,1,1),(2,5,4),(0,1,0)]
sorted list=[(0,1,0),(1,1,1),(1,2,3),(2,5,4)] - Sort a list of date tuples.
a=[(19,3,2022),(16,1,1970),(15,8,1947),(31,12,1946)]
sorted list=[(31,12,1946),(15,8,1947),(16,1,1970),(19,3,2022)] - Sort a list of words based on number of vowels.
a=["Python","Java","C","Fortran","Pascal"]
sorted list=["C","Python","Java","Fortran","Pascal"]
a=[100,2,101]
sorted list =[2,101,100]
a=[11,2,34,60,33,45]
sorted list=[11,33,45,2,34,60]
a=[(1,2,3),(1,1,1),(2,5,4),(0,1,0)]
sorted list=[(0,1,0),(1,1,1),(1,2,3),(2,5,4)]
a=[(19,3,2022),(16,1,1970),(15,8,1947),(31,12,1946)]
sorted list=[(31,12,1946),(15,8,1947),(16,1,1970),(19,3,2022)]
a=["Python","Java","C","Fortran","Pascal"]
sorted list=["C","Python","Java","Fortran","Pascal"]
0 Comments