If you want to change what the variable is referencing, you need to rebind the variable to the new value. int(a) will certainly cast a as an int, but that's a new value. Simply casting it won't change the fundamental meaning of what 3.5467 is. So to rebind the variable, do such: a = int(a)