Sequence Iteration
Syntax: for var in sequence:
statements
E.g.
>>> sum = 0
>>> for i in range(1,10,2):
sum = sum + i
>>> sum
25
Membership operator: in
Previous slide
Next slide
Back to first slide
View graphic version