Computer Science

Find the errors(s)

name = "HariT"
print (name)  
name[2] = 'R' 
print (name)  

Python Data Handling

35 Likes

Answer

The line name[2] = 'R' is trying to assign the letter 'R' to the second index of string name but strings are immutable in Python and hence such item assignment for strings is not supported in Python.

Answered By

16 Likes


Related Questions