logo CodeStepByStep logo

logical_expressions

Language/Type: Python boolean logic expressions

Given the following variable declarations, what is the value of each of the following Boolean expressions? Write True or False for each.

x = 27
y = -1
z = 32
b = False
not b
b or True
(x > y) and (y > z)
(x == y) or (x <= z)
not (x % 2 == 0)
(x % 2 != 0) and b
b and not b
b or not b
(x < y) == b
not (x / 2 == 13) or b or (z * 3 == 96)
(z < x) == False
not ((x > 0) and (y < 0))

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.