In Python, the statements that are processed under the control of a for or while loop are indented and placed after the loop statement. The syntax for a for loop is as follows:
main.py74 chars3 lines
Where item
is a variable that iterates over the iterable
sequence, and the statements that are executed inside the for loop should be indented.
The syntax for a while loop is as follows:
main.py71 chars3 lines
Where condition
is a statement that evaluates to a boolean value, and the statements that are executed inside the while loop should also be indented. The while loop will continue to execute as long as the condition remains True.
gistlibby LogSnag