Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python-for-beginners/12 - Loops/for.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
for name in ['Christopher', 'Susan']:
print(name)
name = ['Christopher', 'Susan'] ## list of names

for nm in name: ## This will iterate(in simple words it will fetch the values) the name list one by one till the last element/values reached
print(nm)

OUTPUT :
Christopher
Susan

# For better understanding just take a list of numbers( i.e, [0,1,2,3,4,5,6,7,8,9]) and iterate this list using a for loop