Skip to content

Latest commit

 

History

History
executable file
·
42 lines (27 loc) · 668 Bytes

for.md

File metadata and controls

executable file
·
42 lines (27 loc) · 668 Bytes

for

Examples in Python 3

"""
Loop through list of items
"""
my_list = [1,2,3]
for x in my_list:
	print(x)

my_list = ["one", "two", "three"]
for x in my_list:
	print(x)


"""
Loop through the characters in a string
"""
my_str = "Hello"
for x in my_str:
	print(x)

Reference and read more

for Statements

The for statement

Revision history

2014-07-17 (sylvanas) PA1 First try.