Video 4: Variables & Expressions (page 3 of 7) |
Python allows you to assign values to multiple variables in one line such as the following:
a, b, c = "Tom", "Joe", "Sally"
In the above example, the value Tom is assigned to the a variable, Joe to the b variable, and Sally to c variable.
You may also assign the same value to multiple variables in a single line such as the following:
a = b = c = "Tom"