Python Boolean Logic
Cai Gengyang
gengyangcai at gmail.com
Sat Sep 23 00:46:28 EDT 2017
Input :
# Assign True or False as appropriate on the lines below!
# (20 - 10) > 15
bool_one = False # We did this one for you!
# (10 + 17) == 3**16
# Remember that ** can be read as 'to the power of'. 3**16 is about 43 million.
bool_two = False
# 1**2 <= -1
bool_three = False
# 40 * 4 >= -4
bool_four = True
# 100 != 10**2
bool_five = False
print ("bool_one = ", bool_one)
print ("bool_two = ", bool_two)
print ("bool_three = ", bool_three)
print ("bool_four = ", bool_four)
print ("bool_five = ", bool_five)
Output :
('bool_one = ', False)
('bool_two = ', False)
('bool_three = ', False)
('bool_four = ', True)
('bool_five = ', False)
Is my logic / input / output correct ? Thanks a lot ...
On Saturday, September 23, 2017 at 12:40:10 PM UTC+8, steve.ferg... at gmail.com wrote:
> You have a lot of assignment statements, but nothing that produces output. Try adding statements like this at appropriate places...
>
> print ("bool_one = ", bool_one)
More information about the Python-list
mailing list