How to Assign Values to Multiple Variables in One Line in Python


In this example, we will learn how to assign values to multiple variables in one line in Python.

Source Code

var1, var2, var3 = 20, '20', 'python'

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

Output:

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