Boolean values Flashcards

1
Q

To conclude with Python’s literals, there are two additional ones.

They’re not as obvious as any of the previous ones, as they’re used to represent a very abstract value - truthfulness.

A

Boolean Values

Each time you ask Python if one number is greater than another, the question results in the creation of some specific data - a Boolean value.

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

The name comes from George Boole (1815-1864), the author of the fundamental work, The Laws of Thought, which contains the definition of Boolean algebra -

A

a part of algebra which makes use of only two distinct values: True and False, denoted as 1 and 0.

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

Python, then, is a binary reptile.

These two Boolean values have strict denotations in Python:

A

True

False

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

You cannot change anything - you have to take these symbols as they are, including case-sensitivity.

Challenge: What will be the output of the following snippet of code?

print(True > False)
print(True < False)

Run the code in the Sandbox to check.

A

1 is greater than zero - True dat!

1 is less than zero - NAY!!!

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

print(“"I’m"\n""learning""\n"""Python"""”)

A

Console
“I’m”
““learning””
“"”Python”””

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