I'm just trying to flip and print the first tuple in a list. If I try this code I get error "cannot unpack non-iterable int object"
lst = [('a',1),('b',2),('c',3)]
for x,y in lst[0]:
print(y,x)
However if I make this simple edit, it works fine. why can't I print a single tuple from a list?
lst = [('a',1),('b',2),('c',3)]
for x,y in lst[:1]:
print(y,x)