Loading topic
print() to show values and know what a program and a statement are. You do not need to know about functions, classes, or loops.6 min readprint(), and know that an assignment like count = 3 binds a name to an object. Here we cover which names Python accepts, which it accepts but you should avoid, and how to pick names that make code easy to read.5 min readprint(). It also assumes you know what a name and an assignment are, as covered in the previous chapters. Here you will learn where Python keeps type information, how to inspect it, and how to avoid the mistakes that come from assuming a name ha5 min readprint(). It also assumes you know that an assignment such as x = 5 binds a name to an object, and that type() reports the type of the object a name currently refers to. Here you learn how to ask whether two names refer to the same object, wh5 min readint and float: how to write them, how they are stored, and where they stop behaving like the numbers from school. It assumes you can run a script or the interactive interpreter, use print(), and know that a name is bound to an object (covered5 min readint, str, and list are different types, and that strings and numbers are immutable while lists are mutable. Here you will use those facts to read and write compact assignment statements correctly and to spot where5 min readprint(), and already know the int and float types and the arithmetic operators from earlier chapters. Here you will see why 0.1 + 0.2 != 0.3, how to compare floats safely, and when to use Decimal instead.4 min readint, float, Decimal, the arithmetic operators, and why 0.1 + 0.2 != 0.3.5 min readprint(), and know that a name is bound to an object. Indexin5 min readprint(), and know that a string (str) is a sequence of text characters written in quotes. You should also know that a name refers to an object. Here you will learn how to pull single characters and pieces out of a string, and how to avoid the er5 min readstr to be immutable, what happens when code seems to change a string, and why the language works this way. It assumes you can run Python, use print(), and index and slice strings (s[0], s[1:4]). It also assumes you know that an assignment bind5 min readprint(), and know the difference between int, float, and str. You should also know that a float is a binary approximation. The chapter covers the full f-string syntax, the format specification mini-language, and the errors people hit4 min readstr, int, and float are different types. It also assumes you can use f-strings for basic output and read a traceback. Here you will learn what the parsing functions accept, how they fail, and how to turn numbers back into text on purpose.5 min readtry/except. It adds one distinction. A str is text, and bytes is raw data. Python converts between them only when you ask it to.4 min read