June 2002
Beginner to intermediate
640 pages
14h 24m
English
A statement is simply an instruction to Python to perform a task. Through the interpreter, Python reads the statement and does as instructed. In other words, it executes the statement. In this example, each line is a statement.
Hello = "Hello %s how are you doing"
from java import awt
print ("Hello World")
By default, a statement is contained on a single line. A multiline statement is indicated by a backslash at the end of each of its lines and an indentation at the beginning of the next. Here's one complete statement spanning two lines:
>>> reallyLongLine = 5 + 5 - 5 * 5 /5 * 100 - 1000 \ + 200 - 300 + 60 / 5
Two statements can fit on one line if they're separated by a semicolon.
>>> print("Hello"); print("Goodbye") Hello Goodbye ...Read now
Unlock full access