02 Control Statements Flashcards

(11 cards)

1
Q

Boolean

A

Type of variable that can take one of two values - True or False

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

!=

A

Test if two variables are not equal

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

Boolean Operator: X and Y

A

if X and Y are both true

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

Boolean Operator: X or Y

A

Checks if one is true

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

if statements

A

if statement is true, code indented into it will run, otherwise elif or else code is run

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

for loops

A

Repeat an operation a specific number of times

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

while loops

A

Performs a task while the specified statement is true

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

break

A

Break out of a for or while loop

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

continue

A

Prematurely go into the next iteration of the loop
OR
skip over the remaining code in the loop body

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

pass

A

does literally fuck all
often used during development where syntactically code is required but not written
helps readability

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

infinite loops

A

loop is entered but never terminates
render a system unresponsive

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