Write the output of the following code and explain the output. (10 marks)
str='MIS 525'
str[4]='-'
print(str)
Error Message:
Traceback (most recent call last): File "number6.py", line 2, in <module> str[4]='-'
What is the reason why this code does not run? How can you fix it?
As strings are immutable in python we cannot change the elements in the string by indexing
WE can correct the error by joining lists by splicing
str='MIS 525'
# str[4]='-'
str=str[:3]+'-'+str[4:]
print(str)
The output is given below

Write the output of the following code and explain the output. (10 marks) str='MIS 525' str[4]='-'...