K12教育赛事综合服务平台
聚乐之家官方网站
下载聚乐之家官方App
专注青少年竞赛题库网站
test_str = "python" # 尝试通过索引修改字符串字符 test_str[] = "P" print(test_str)
代码正常运行,输出Python
Python
代码正常运行,输出python
python
运行时抛出TypeError: 'str' object does not support item assignment
TypeError: 'str' object does not support item assignment
运行时抛出NameError: name 'test_str' is not defined
NameError: name 'test_str' is not defined