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

719 B
Raw Blame History

title tags aliases
expressions
python
expressions
syntax
expression
evaluate

[!note] Concept
An expression is a combination of values, variables, and operators that evaluates to a single value.

[!example] Examples

2 + 3           # 5
'a' * 3         # 'aaa'
myAge + 1       # if myAge is an integer

[!important] Best Practices

  • Expressions dont store data — they compute and return a value.
  • You can use expressions inside function calls, assignments, etc.

[!info] Related Notes
arithmeticOperators
booleans
typeConversions
pythonSyntaxOverview