True or False? โ๏ธ
Python can answer questions. Not big life questions โ but questions like "is this bigger than that?" It always answers with True or False.
print(10 > 3) # โ True (> means "greater than")
print(2 > 100) # โ False
print(5 == 5) # โ True (== means "is equal to")
print(5 != 5) # โ False (!= means "is NOT equal to")
โ ๏ธ Watch out for the sneakiest thing in all of Python:
- one equals sign
=means store this (cookies = 12) - two equals signs
==means is this the same? (cookies == 12)
True and False are a brand new kind of value called a boolean. They're not text, so they never get quotes.
Your mission
- Make a variable
cookiesand store a number in it - Print at least 3 comparisons about
cookies(use>,<,==,!=) - Make at least one of them come out True and one come out False
Your code
Press โถ Run to see what your code does!