0
numeric type conversion
I find that Int(x) can't really change the type of x, I need to create a new variable to save it .It same as before when I print it again
1 Respuesta
+ 1
x = str(input( ))
#storing input as string
y = int(x) + 2
print(y)
The need of creating a new variable is imminent.
But it still works
Or
you can simply print what you want
print(int(x) + 2)
This way, you don't need to create anything new