Back Navigation Next Navigation Conceptual Review (page 16 of 55)

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. We can do this in multiple statements as well

a = "Tom"
b = "Joe"
c = "Sally"

The data types of a, b, and c are strings (str).

You may also assign the same value to multiple variables in a single line such as the following:

a = b = c = "Tom"