# Read an integer:
a = input()
#Now swap it...
a[0] = a[1]
a[1] = a[0]
As you can see I am trying to change the value and trying to swap it..
print(a)
...and then i print it out. But I am getting an error which is as follows:
Traceback (most recent call last):
File "python", line 4, in <module>
TypeError: 'str' object does not support item assignment
For example, if my input is 79
I want the result to be 97
. Can you tell me where my mistake is?