February 2006
Intermediate to advanced
648 pages
14h 53m
English
Each statement in a program is terminated with a newline. Long statements can span multiple lines by using the line-continuation character (\), as shown in the following example:
a = math.cos(3*(x-n)) + \
math.sin(3*(y-n))You don’t need the line-continuation character when the definition of a triple-quoted string, list, tuple, or dictionary spans multiple lines. More generally, any part of a program enclosed in parentheses (...), brackets [...], braces {...}, or triple quotes can span multiple lines without use of the line-continuation character because they denote the start and end of a definition.
Indentation is used to denote different blocks of code, such as the bodies of functions, conditionals, loops, and ...