Booleans and None
True and False are booleans. None means no value. Empty values such as 0, "" and [] are falsy. Use is to compare with None.
Example
x = None
print(x is None, bool(0), bool("a"), bool([]))
print(True + True)Result
True False True False 2
Exercise
Check for None.
x None
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.