Lesson 3
Discovering your Paths
Chapter 2: Comparison operators
Comparing literals
Now, try these out yourself!
What do you think is the output of the following boolean expressions? Try to guess the answer, and use the system to check your answer. Then test them out on a Python interactive prompt yourself if you are not convinced!
Warning - some of these are trick questions!! 😈 Some of the quirks are specific to the Python language. They may behave differently in another language.
Make sure you understand them to ensure that you never fall into Python’s evil traps! 🐍
As usual, be curious. If you find yourself wondering about some new case, try it out yourself on an interactive prompt to see what pops up, and try to understand why!
❮
❯