If I do this, I get:
>>> x = 1
>>> y = '2'
>>> type(x)
<class 'int'>
>>> type(y)
<class 'str'>
That all makes sense to me, except that if I convert using:
>>> str(x)
'1'
>>> type(x)
<class 'int'>
>>> int(y)
2
>>> type(y)
<class 'str'>
...why are my types only temporarily converted, i.e. why despite str(x) and int(y) is x still an integer and y is still a string?
Do I have to replace x and y to make type permanent with:
>>> x = '1'>>> y = 2>>> type(x)<class 'str'>>>> type(y)<class 'int'>
I can see how it's useful to have the type of a variable permanently fixed, but as a new coder it's good to know what I'm contending with.