Urutkan daftar tupel berdasarkan item dalam python
lst = [("val1", 2), ("val1", 1)]
lst.sort()
print(lst)
# Output: [('val1', 1), ('val2', 2)]
AttractivePenguin
lst = [("val1", 2), ("val1", 1)]
lst.sort()
print(lst)
# Output: [('val1', 1), ('val2', 2)]