I have:
x = float(1.0)
y = int(2)
t1 = type(x)
t2 = type(x).__name__
If I print t1
and t2
I can see the following:
print t1
>>> <type 'float'>
print t2
>>> float
How can I use t1
or t2
to change y
into type float
with the least amount of code?