Loading topic
if statements. You should also know the built-in types int, str, list, and dict. Later chapters cover truthiness, comparisons, and None in detail. This one introduces the type that underlies all of them.2 min readif statements) and the built-in types int, str, list, and dict. It covers how Python decides whether any object counts as true or false.3 min readif statements and functions, and have used int, str, list, and dict. It covers the six comparison operators, what they return, and how they behave on different types. Chained comparisons, is versus ==, and None checks get t3 min readif statements, and that you know how comparison operators such as <, ==, and != produce bool values. Here you will learn how Python lets you chain several comparisons in one expression, what that expression really means, and whe3 min readbool type, truthiness, and comparison operators from the earlier chapters. Here you will combine several conditions into one expression and avoid the usual mistakes.2 min readand, or, and not combine conditions. Here you will see that and and or return one of their operands, not always True or False, and that they sometimes skip evaluating the right-hand side.2 min readif statements) and the built-in types int, str, list, and dict. It covers what None is, where it shows up, and how it differs from the other "empty" values. Later chapters cover is versus == and default argument3 min readif statements, and the built-in types list, int, and str. It also assumes you know that None is Python's "no value" object.3 min readis and ==. It covers the two jobs None does most often: marking a missing value and serving as a safe default argument.2 min readint, str, and list. You should also know what truthiness is: bool(value) decides whether a value counts as true or false. Here you will see how bool relates to int, what that allows, and which bugs it causes.2 min readand and or short-circuit. It also assumes you can write a generator expression such as (n > 2 for n in nums).3 min readis versus ==, and None. It collects the mistakes that still catch people who know the rules.3 min read__init__ and methods. It also assumes you know how truthiness, ==, and is work for built-in types. Here you will control what if obj: and a == b mean for your own objects.2 min read