Single Choice
Not Set
QWhat will be the output after the following statements?
x = 'Today is a nice day'
x[9] = 'not '
print(x)
ID: #3998
Python Errors and Exceptions Handling
305 views
Question Info
#3998Q ID
Not SetDifficulty
Python Errors and Exceptions HandlingTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
TypeError
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Input In [86], in| () 1 x = 'Today is a nice day' ----> 2 x[9] = 'not ' 3 print(x) TypeError: 'str' object does not support item assignment --------------------------------------------------------------------------- |
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic