I'm trying to sort these coordinates by the first element and the second element. The first element are just simple alphabets, and the second element are numerical values.
I found out how to make the program print by the first element - by alphabetical order. Which works - but I'm having difficulties with attempting to solve it by the numerical values.
How would this problem be apporached?
coor_tuples = [
('f', 9),
('z,', 2),
('t', 4),
('x', 8),
('b', 1),
('m', 7)
]
sorted(coor_tuples, key=lambda coor: coor[1])
print(coor_tuples)