Questions: Boolean Type and Truth Values

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A programmer writes: is_raining = temperature < 32. When temperature holds the value 45, what is stored in is_raining?

A45
B32
Ctrue
Dfalse
Question 2 Multiple Choice

Which statement best describes what the expression x > 10 produces when evaluated in a program?

AThe number 1 if x is greater than 10, or 0 otherwise
BA boolean value — either true or false — depending on x's current value
CNothing — it tests a condition but does not produce a storable value
DThe difference between x and 10
Question 3 True / False

The result of a comparison like age >= 18 can be stored in a variable, just like a number or text value.

TTrue
FFalse
Question 4 True / False

Because booleans represent simple yes/no answers, each comparison is expected to stand on its own — boolean values can seldom be combined with other operations.

TTrue
FFalse
Question 5 Short Answer

A classmate argues that booleans are just 0 and 1 and there's no reason to treat them differently from numbers. Why is this view incomplete?

Think about your answer, then reveal below.