voidex/20-29 Areas/20 Programming/20.01 Python/statements.md

31 lines
747 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: statements
tags:
- python
- statements
- syntax
aliases:
- statement
- code-line
---
> [!note] Concept
> A **statement** performs an action. It could assign a value, call a function, define something, or control flow.
>
> > [!example] Examples
> > ```python
> > x = 10 # assignment statement
> > print("Hello") # function call statement
> > if x > 5: # control statement
> > print(x)
> > ```
>
> > [!important] Statement vs Expression
> > - An **expression** evaluates to a value.
> > - A **statement** does something — it doesnt always return a value.
>
> > [!info] Related Notes
> > [[expressions]]
> > [[functions]]
> > [[conditionals]]
> > [[pythonSyntaxOverview]]