week 4 - branching Flashcards

1
Q

bool type

A

stores as True or False

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

___ and ___ expressions evaluate to bool types

A

relational and logical

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

relational operators

A

compare two things

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

!=

A

not equal

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

<=

A

less than or equal to

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

> =

A

more than or equal to

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

not

A

opposite of evaluated type

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

and

A

both need to be true for an and statement to evaluate to true

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

or

A

one or more needs to be true for or to evaluate to true

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

if branching format python

A

if (expression):
# code
else:
# code

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

what distinguishes branch code from the rest?

A

indent

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

multiple branches

A

elif (exp):
# code

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

if branch

A

branch that only operates if expression is true

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

if-else branch

A

two branches, if input doesn’t fit into if exp, then else is executed

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

if-elif-else

A

each branch of code is executed until one is true

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

detecting ranges with branches

A

you can use multiple branches to check for numbers in certain range

17
Q

operation chaining

A

using multiple operations in one line of code
ex:
a < b < c

18
Q

logical operators

A

evaluates to bool value, includes and, or, and not