Assign the same value to multiple variables

Assign the same value to multiple variables
Assign the same value to multiple variables

You can assign the same value to multiple variables by using = consecutively.

This is useful, for example, when initializing multiple variables to the same value.

a = b = c =100

print(a)

# 100

print(b,c)

# 100 100

Posted in PYTHON.

Leave a Reply

Your email address will not be published. Required fields are marked *