Get answer of your all questions and doubts! ➤

Question
If you give the following for str1 = “Hello”, why does Python report error?
str1[2] = ‘p’

[Computer Science Class – 11 Sumita Arora solutions. Chapter 6 – Data Handling.]

Answer

Python reports error because strings are immutable.

Leave a Comment

Your email address will not be published. Required fields are marked *