How to Assign Same Value to Multiple Variables in Python


In this example we will show how to assign the same value to multiple variables in one line in Python.

Source Code

var1 = var2 = var3 = 'python'

print(var1)
print(var2)
print(var3)

Output:

python
python
python
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments