>>> t=('a','b',"'c','d'") >>> print t ('a', 'b', "'c','d'") >>> print t[0] a >>> print t[2] 'c','d' >>> L=t[2] >>> L[1] 'c' >>> L[1]='D' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'str' object does not support item assignment
两个问题:
1 为何L[1]输出的是c,不应该是d吗?
2 为何教程4.9内可以给L赋值,而我这边不行?
谢谢!
昵称2_18位中英文
相关分类