The general form of a for loop through a list in Python take the Linguistic form:
for iterator in List: Do Something with iterator
Example:
List = [1, 2, 3, 4]
for iterator in List: print iterator*2
2 4 6 8
No comments:
Post a Comment