📚 node [[expressions and variables]]

Expressions and Variables

Go to the[[Python Week 1 Main Page]] or the [[Python - Main Page]] Also see the [[Programming Main Page]] or the [[Main AI Page]]

Expressions

Operations that Python and the computers perform.

50 + 60 * 2 = 170

  • Operands: The numbers in the operation
  • Operators: The signs in the operation

A note on division

Division: 25 / 6 = 4.166 ... <- the result is a float and approximate. Integer Division: 25 // 6 = 4 <- the result is an int and has lost precision.

Python3 follows order convention.

Variables

We use variables to store values in multiples places. We assign variables a value using the = operator.

We can perform operations on variables and assign the value to variables, and pass them into functions like type() just like before.

📖 stoas
⥱ context
⥅ related node [[week1 types expressions and variables lab]]