On p. 162 of "Programming In Python", 2nd ed., by Summerfield, the
section entitled "for Loops" begins:

=========================================
for expression in iterable:
     for_suite
else:
     else_suite

The expression is normally either a single variable or a sequence of
variables, usually in the form of a tuple. If a tuple or list is used
for the expression, each item is unpacked into the expression's items.
======================================

I thought I was quite familiar with for loops, but I don't understand
how the expression can be a sequence of variables, nor what  unpacking
into the expression's items means. Could someone explain this,
preferably with an example?

Thanks,

Dick Moores
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to