Truthy/Falsy Value Flashcards

1
Q

Is 0.0 (float) truthy or falsy?

A

Falsy

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

Is -1 truthy or falsy?

A

Truthy

Any non-zero number is Truthy

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

Is an empty string “” truthy or falsy

A

Falsy

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

Is this “ “ (non-empty String) truthy or falsy

A

Truthy

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

Is this “abc” truthy or falsy

A

Truthy

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

Is an empty list [] truthy or falsy

A

Falsy

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

Is None truthy or falsy

A

Falsy

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

Is this list [None] truthy or falsy

A

Truthy

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

Is this list [0] truthy or falsy

A

Truthy

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

Is an empty tuple () truthy or falsy

A

Falsy

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

Is an empty set truthy or falsy

A

Falsy

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

Is an empty dict truthy or falsy

A

Falsy

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

Is an empty range range(0) truthy or falsy

A

Falsy

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

Are class instances truthy or falsy by default

A

Truthy

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

Is the string “False” truthy or falsy

A

Truthy

Because it’s simply a non-empty String

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

Is float(‘inf’) truthy or falsy