class source():
def __init(self, _source: object):
self.source = _source
def __str__(self):
return (f"source: {self.source}")
value0 = 10
value1 = source(value0)
print(value1)
This will print out "source: 10".
However i want it to print out "source: value0", because if i want to change value0 to 15 it will return a different string.
Its also for readability, it will make it more clear where the value is coming from.
How do i get the name of a float (or int) type variable?