February 2024
Beginner
352 pages
8h 16m
English
The logic combinations you learned from the previous exercise are called “Boolean” logic expressions. Boolean logic is used everywhere in programming. It is a fundamental part of computation, and knowing these logic expressions very well is akin to knowing your scales in music.
In this exercise, you will take the logic exercises you memorized and start trying them out in Python. Take each of these logic problems and write what you think the answer will be. In each case, it will be either True or False. Once you have the answers written down, you will start Python in your Terminal and type each logic problem in to confirm your answers.
True and True
False and True
1 == 1 and 2 == 1
"test" == "test"
1 == 1 or 2 != ...
Read now
Unlock full access