Chapter 2. Lexical Conventions and Syntax

THIS CHAPTER DESCRIBES THE SYNTACTIC AND LEXICAL CONVENTIONS of a Python program. Topics include line structure, grouping of statements, reserved words, literals, operators, tokens, and source code encoding. In addition, the use of Unicode string literals is described in detail.

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.