Oct-15-2017, 09:38 PM
Thanks for answering but I think you've misunderstood my question. I'm trying to understand the difference in these:
for name, species, weight in pets: print(name, species, weight) for [name, species, weight] in pets: print(name, species, weight) for (name, species, weight) in pets: print(name, species, weight)Especially the last two. I know what they do, but is there a difference? Asked another way, does it make a difference if you use () or [] on the left hand side of an assignment? If not in my case, does it ever make a difference if there is a tuple (or other iterable) on the right hand side?