June 2025
Beginner to intermediate
473 pages
13h 30m
English
Python statements usually consist of a single line. Unlike many other programming languages, they do not end with a semicolon or any other character.
Multiline statements are allowed if their beginning and end are clearly indicated by parentheses, for example, in function calls. Alternatively, multiline statements can also be formulated using the \ separator:
print("abc", "efg")a = 1 + 2 + \ 3 + 4 Statements may end with a semicolon. Normally, this semicolon is optional and has no effect on the program execution. Semicolons, however, allow multiple statements to be formulated on a single line:
a = 1; b = 2; c = 3
You can also perform this triple assignment in another way, by specifying both the variables and ...
Read now
Unlock full access