CBSE Class 11 Computer Science Question 86 of 173

Data Handling — Question 15

Back to all questions
15
Question

Question 15

If you give the following for str1 = "Hello", why does Python report error?

str1[2] = 'p'

Answer

Python reports error because strings are immutable and hence item assignment is not supported.

Answer