9.3 Python Flashcards
1
Q
sequence
A
the order the code should run, if incorrect then program won’t do what it is supposed to
2
Q
Selection (IF)
A
a decision - choosing which lines of the instructions to run depending on a condition
e.g
if age < 18:
3
Q
variable
A
a variable is like a box that is stored in the computer’s memory, variables can be labelled
4
Q
what is ==
A
equal to
5
Q
what is !=
A
not equal to
6
Q
what is >
A
greater than
7
Q
what is <
A
less than
8
Q
Iteration (FOR)
A
repeating lines of instructions when you know how many times to repeat
e.g
for counter in range(10):
9
Q
Iteration (WHILE)
A
While loop will keep repeating until soemthing changes. It uses a specific variable called a ‘sentry’
e.g
sentry = “Carry on”
while sentry == “Carry on”: