'str' object does not support item assignment code example
Example 1: str object does not support assignment python
>>> str1 = "mystring"
>>> list1 = list(str1)
>>> list1[5] = 'u'
>>> str1 = ''.join(list1)
>>> print(str1)
mystrung
>>> type(str1)
<type 'str'>
Example 2: TypeError: 'tuple' object does not support item assignment
# if you are trying to replace the existing value in a tuple with a new value then this error occurs.
#Ex:
languages = ('C', 'Python', 'Scrapy')
languages[2] = 'Java'