Glossary · Phase 0 · Tools
Boolean
A value that is either True or False.
A comparison asks a yes-or-no question, like a light switch that's either on or off. The answer is a boolean:
TrueorFalse.
Try it now
Watch which lines the highlight visits. The first condition is False, so Python moves to the elif. That one is True, so it runs and the else is skipped entirely. Try it again in your head with ctr = 0.01.
Learn it properly
Decisions with if/else · Compare values and choose what happens next. About 20 minutes.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.