# This statement adds two numbers and returns the result
Front
5 + 3 # This statement adds two numbers and returns the result
Back
How to use "For Loop"
Front
In Python, "for loops" are called iterators.
Just like while loop, "For Loop" is also used to repeat the program.
But unlike while loop which depends on condition true or false. "For Loop" depends on the elements it has to iterate.
Back
# This statement begins a for-loop
Front
for player in players:
Back
A function
Front
A function is an object. There's statements to create functions, like def:
Back
How to use "enumerate" function for "For Loop"
Front
Enumerate function in "for loop" does two things
1. It returns the index number for the member
2.And the member of the collection that we are looking at
Back
Continue statement in for loop
Front
Continue statement can be used in for loop when you want to fetch a specific value from the list.
Back
While Loop Syntax
Front
while expression Statement
Back
# This is a statement that calls the print function