I\'m a programming newbie and am having some trouble understanding an example from my python textbook (\"Beginning Python\" by Magnus Lie Hetland). The example is for a recu
the try except construction catches the exception for you and yields nested back which is just the argument that was given to flatten().
try
except
nested
flatten()
So flatten(1) will go wrong in for sublist in nested: and continues with the except part and yields nested which is 1.
for sublist in nested:
1