Show Menu

Statements and Loops Cheat Sheet by

loops     statements

If Else Statements

Passes into code if True
If last statement was not True, check this statement
If all statements prior were False, handle this statement as True

For Loops

for i in range(­num):
From 0 to num-1, do
for i in range(­len­(li­st)):
From 0 to length of list-1
for item in list:
Iterates through each item in collection data type

Control Statements

Exits loop
Moves to next Iteration

While Loops

while statement:
Continues until statement is False
while 1:
Continues until statement is False
while True:
Continues until statement if False

Download the Statements and Loops Cheat Sheet

1 Page

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!



No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          PHP Syntax for beginners Cheat Sheet

          More Cheat Sheets by crystinvw