Conditions & Conditional Statements Flashcards

1
Q

In programming, conditions are statements that are either what?

A

T or F

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

Equals symbol

A

==

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

Does not equal symbol

A

!=

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

Less than

A

<

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

Less than or equal to

A

<=

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

Greater than symbol

A

>

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

Greater than or equal to

A

> =

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

How do you check a value?

A

==

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

How do you set a value?

A

=

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

The code under the “if” statement is run if the statement is what?

A

T

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

The code under the “else” is run if the statement is what?

A

False

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

elif is used to check if what?

A

Multiple conditions might be true

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

elif stands for?

A

Else if

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

When making a comparison what should you use?

A

==

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

When you write n == 6 what are you doing?

A

Setting the value of n

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

When you write m = 17 what are you doing?

A

Changing the value of m

17
Q

How can you combine boolean values using standard concepts?

A

“and”
“or”
“not”

18
Q

Which is evaluated first and/or?

A

And

19
Q

Conditional statements are often referred to as what?

A

If-then statements

20
Q

All numbers are treated as true except what?

A

0

21
Q

All strings are treated as true except what?

A

An empty string

22
Q

Generally empty sequences are what?

A

Falsey & truthy

23
Q

With the and operator all conditions must be what?

A

True

24
Q

With the or operator how many conditions need to be True?

A

Only 1

25
Q

When doing if elif and else statements which one will get executed?

A

Only the FIRST true condition