Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In Python, variables are simply names for values. Therefore, two distinct variables cannot have the same value, as they would refer to the same object.

However, if you want to create two separate objects with the same value, you can use the following code:

a = 10
b = 10

Here, the variables a and b are separate objects that both have the value of 10.