i see tea Flashcards

1
Q

Python supports the usual logical conditions from mathematics:

A

Equals: a == b

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

a == b
a != b
a > b
a < b

A

equals
not equal to
greater than
less than

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

Python relies on ___to define scope in the code. Other programming languages often use curly-brackets for this purpose.

A

indentation (whitespace at the beginning of a line)

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

is Python’s way of saying “if the previous conditions were not true, then try this condition”.

A

elif

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

catches anything which isn’t caught by the preceding conditions.

A

Else

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

catches anything which isn’t caught by the preceding conditions.

A

Else

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

If you have only one statement to execute, you can put it on the same line as the if statement

A

Short hand if

If a > b: print (“ a is greater than b”)

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

is logical operator, and it is used to combine conditional statements

A

And

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

Is logical operator, and it is used to reverse the result of the conditional statements

A

Not

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

If you have if statements inside if statements, this is called

A

nested if statements

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

If statements cannot be empty, but if you for some reason have an if statement with no content, put in the

A

pass statement

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