Python Variables - Assign Multiple Values
Python Variables - Assign Multiple Values
Multiple Values
❮ PreviousNext ❯
Example
x = y = z = "Orange"
print(x)
print(y)
print(z)
Try it Yourself »
Unpack a Collection
If you have a collection of values in a list, tuple etc. Python allows you to extract
the values into variables. This is called unpacking.
Example
Unpack a list: