Skip to Content
Python Distilled
book

Python Distilled

by David M. Beazley
September 2021
Beginner to intermediate
352 pages
11h 27m
English
Addison-Wesley Professional
Content preview from Python Distilled

2. Operators, Expressions, and Data Manipulation

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.

2.1 Literals

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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Testing with pytest

Python Testing with pytest

Brian Okken
Robust Python

Robust Python

Patrick Viafore

Publisher Resources

ISBN: 9780134173399