python articles on day 5 [variable]

Day 4 Overtime
Multiple variable assignment
Python allows you to assign multiple variables simultaneously. E.g:
a = b = c = 1
Examples of the above, an object to create an integer, a value of 1, three variables are assigned to the same memory space.
You can also specify multiple variables into multiple objects. E.g:
a, b, c = 1, 2, "john"
The above example, two integer objects 1 and 2 is allocated to the variable a and B, string objects "john" to the variable c.

Guess you like

Origin www.cnblogs.com/TomBombadil/p/10979601.html