Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
What does each line show? print(True and False), print(True or False), print(not True), print((3 > 2) and (5 < 4)), print((3 > 2) or (5 < 4)).
Work out each comparison first. Then use and, or and not.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
True and False: both must be true, and one is not: False.True or False: one is true: True.not True: flips: False.(3 > 2) and (5 < 4): True and False, because 5 is not less than 4: False.(3 > 2) or (5 < 4): True or False: True.Answer: False, True, False, False, True.
Log in to join the discussion.
Loading…