Assignment Statements
Learn about assignment statements in Python.
We'll cover the following...
Syntax
Assignment statements consist of a variable, an equal sign, and an expression.
Here’s an example:
Press + to interact
x = 1 # Assigning the value 1 to a variable xprint("x:", x)y = 5 # Assigning the value 5 to a variable yprint("y:", y)z = x + y # Assigning the value of the addition between x and y to zprint("z:", z)
Assignment shortcuts
You can also use shortcuts when ...