Why are integers immutable in Python?
Making integers mutable would be very counter-intuitive to the way we are used to working with them. Consider this code fragment: a = 1 # assign 1 to a b = a+2 # assign 3 to b, leave a at 1 After these assignments are executed we expect a to have the value 1 and … Read more