Skip to main content

Statements

Every line in a Python file is called a statement.

Your computer reads statements like how you would read sentences.

Like how you would combine sentences into paragraphs, each statement has a purpose, and when combined with other statements forms a program.

Examples

statement_examples.py
# Remember this from last chapter? This is a Python statement!
print("Hello, World!")

# Other statement examples:

x = 1 # This is a statement

y = 3 # So is this

z = x + y # This too!