9.3 Python Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

sequence

A

the order the code should run, if incorrect then program won’t do what it is supposed to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Selection (IF)

A

a decision - choosing which lines of the instructions to run depending on a condition

e.g
if age < 18:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

variable

A

a variable is like a box that is stored in the computer’s memory, variables can be labelled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is ==

A

equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is !=

A

not equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is >

A

greater than

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is <

A

less than

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Iteration (FOR)

A

repeating lines of instructions when you know how many times to repeat

e.g
for counter in range(10):

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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”:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly