I want to use the name of an assigned variable and not the values in it.
Example:
y1 = 1000
y2 = y1
Goal is to get "y1" as string from y2 and not the value of 1000
I tried:
print(f"{y}")
and got 1000
I want to use the name of an assigned variable and not the values in it.
Example:
y1 = 1000
y2 = y1
Goal is to get "y1" as string from y2 and not the value of 1000
I tried:
print(f"{y}")
and got 1000
I don't think it's possible doing what you are asking for, the way you are describing it.
Here we have the distinction between a variable and a value. By doing this: y1 = 1000, you are setting the value 1000 (int) to the variable y1. By doing this: y2 = y1, not only you are assigning the value of the variable y1 to y2, but you are also pointing to the memory address where y1 keeps 1000.