Section 1

Preview this deck

condition

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (16)

Section 1

(16 cards)

condition

Front

any expression that evaluates to True or False. The while loop will keep repeating the indented instructions while the condition is True.

Back

accumulator variable

Front

accumulates a value by changing it in every iteration of the loop

Back

iteration

Front

each repetition of the loop

Back

while loop

Front

repeats a block of instructions as long as a given condition is True.

Back

break

Front

immediately ends a while loop (i.e. "jump out" of the loop and execute the instruction (if there is one) after the while loop

Back

else statement

Front

runs the indented instructions if the condition of the if statement is False. The else statement represents the if statement's condition being False, so there is no condition written with it.

Back

elif statement

Front

only checks its condition if no previous condition was True. It's possible that none of the instructions are executed!

Back

If, Else, Elseif statements

Front

only checks its condition if no previous condition was True. At least the instruction(s) after the else will be executed!

Back

branching in while loop

Front

an if statement nested in a while loop

Back

initial value

Front

the starting value that is used for the first iteration of the while loop

Back

nested if statements

Front

an if statement runs one or more instructions if a certain condition is True. One or more of these instructions can be an if statement. Its is said to be "nested" under the first if statement.

Back

initialization

Front

assign a starting value to a variable

Back

multiple if statement

Front

are evaluated in the order they are written

Back

if statement

Front

runs specific instructions if a certain condition is True. Allows values in your program to control whether certain instructions are performed. After the condition, there is a colon (:), and the instructions controlled by the if statement are indented with tabs.

Back

increment / decrement -

Front

to end the loop, the condition must eventually become False. Each iteration of the loop should increment or decrement the variable so it eventually reaches the maximum or minimum value.

Back

condition

Front

of an if statement can be any logic expression.

Back