For Loops and TuplesThe for statement iterates over the elements of a sequencefor i in [3,4,5,6,7]: print i If the sequence contains tuples of equal size, can assign to multiple namesfor x,y in [(2,3),(4,5),(5,6),(7,8)]: plot(x,y) |
<<< | O'Reilly OSCON 2000, Introduction to Python, Slide 67 July 17, 2000, beazley@cs.uchicago.edu |
>>> |