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(5 > 3), print(4 == 4.0), print(7 != 7), print("apple" < "banana").
A comparison gives True or False.
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.
5 > 3 is true: True.4 == 4.0: a whole number and a decimal number with the same value are equal: True.7 != 7 asks if 7 is not equal to 7. It is equal, so False."apple" < "banana": text is compared like words in a dictionary, and apple comes first: True.Answer: True, True, False, True.
Log in to join the discussion.
Loading…