Computer Science

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

str1[2] = 'p'

Python Data Handling

20 Likes

Answer

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

Answered By

13 Likes


Related Questions