Loading topic
int, float, str, bool, list and dict, and can assign to variables. It covers the operators that compute numbers: what each one does, what type it returns, and where it fails. Division, floor division and modul4 min readint and float, and that you have read the earlier chapters on expressions and arithmetic operators. It covers three operators that people often treat as one: /, // and %. It shows how they relate, what happens with negativ4 min readint and float, and have read the chapter on comparison operators. Here you will learn why == on floats sometimes fails, how large the error is, and how to compare floats correctly.4 min readint, float, str, bool, list and dict. It covers what the six comparison operators return, how they behave across types, and how your own classes take part in them. Chained comparisons and the is operator have thei4 min read<, <=, >, >=, ==, !=) and that and/or combine boolean values. It covers how Python expands a chain of comparisons, when the middle operands are evaluated, and which chains read differently from what they look like.5 min readint, str, list and dict. It also assumes you know that a variable name refers to an object. It explains what == and is test, why they can disagree, and which one to use in each case.5 min readint, float, str, bool, list and dict, and can assign to variables. It also assumes you know == and is from the comparison chapters. Here you will learn which values count as true or false when Python needs a yes-or4 min readbool, int, str and list. It also assumes you know how comparison operators like == and < work, and that every value in Python is either truthy or falsy (empty containers, 0, None and False are falsy). Here you4 min readand, or and not in if conditions. Here you will learn two facts about and and or that many people miss. They return one of their operands, not necessarily True or False. They4 min readand and or. A conditional expression chooses between two values inside a single expression. It is Python's version of the ternary operator found in other languages.4 min readin and not in operators. It assumes you know Python's core built-in types (str, list, tuple, dict, set), how to run a script or the REPL, and how comparison with == works. Identity versus equality was covered in an earlier chapter, and it matters here because 5 min readstr, list, tuple, int, bool). It also assumes you know simple assignment and the arithmetic and comparison operators from earlier chapters. Here you will see how the same symbols behave on sequences, wh4 min readint, float, str, list, dict), and have used simple assignment like x = 3. It covers what assignment does, the forms it takes, and how += and the other augmented operators differ from writing out x = x + 1.5 min read=, if and while statements, list comprehensions, and basic function calls. You should also know that an expression produces a value and a statement does not.4 min readint type works and can read binary literals like 0b0101. It also assumes you know the general idea of operator precedence. You will learn each operator, how negative numbers behave, and common bit4 min read__init__, and that you know the operators from the earlier chapters: arithmetic, comparison, in, and the truthiness rules. Here you will see that those operators are calls to special methods, and you will make your own classes work with them4 min read