September 2021
Beginner to intermediate
352 pages
11h 27m
English
This chapter describes Python’s expressions, operators, and evaluation rules related to data manipulation. Expressions are at the heart of performing useful computations. Moreover, third-party libraries can customize Python’s behavior to provide a better user experience. This chapter describes expressions at a high level. Chapter 3 describes the underlying protocols that can be used to customize the behavior of the interpreter.
A literal is a value typed directly into a program such as 42, 4.2, or 'forty-two'.
Integer literals represent a signed integer value of arbitrary size. It’s possible to specify integers in binary, octal, or hexadecimal:
42