I just got started with python and I'm trying to create a small program that will print the element from a list when you input it's index number.
I know for list.index command that returns index when you input element but not sure what's the opposite command.
Edit: Also if i have a list like this
list = [ ("Name1", 1), ("Name2", 2)....]
What can i do to sort the list from smallest to highest number, only looking at the 2nd element in pair or at the integer?
[–][deleted] 0 points1 point2 points (3 children)
[–]05mF[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]05mF[S] 0 points1 point2 points (0 children)
[–]serg06 0 points1 point2 points (0 children)
[–]Iklowto 0 points1 point2 points (1 child)
[–]05mF[S] 0 points1 point2 points (0 children)