You can even assign values to multiple variables in a single line, like
>>> a , b =45, 54>>> a
45>>> b
54
Using this swapping two numbers becomes very easy
>>> a, b = b , a
>>> a
54>>> b
45
To understand how this works, you will have to learn about a data type called tuple. We use comma to create tuple. In the right hand side we create the tuple (we call this as tuple packing) and in the left hand side we do tuple unpacking into a new tuple.
Below we have another example of tuple unpacking.
>>> data =("Kushal Das", "India", "Python")>>> name, country, language = data
>>> name
'Kushal Das'>>> country
'India'>>> language
'Python'