Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
l = [3,7,7,78,12,[1,4,'hello']]
Ans 下面不显示输出:
l[4][2] = "goodbye" print(l)
嵌套列表 [1,4,'hello'] 位于第 5 个索引中。
你应该做:
l = [3,7,7,78,12,[1,4,'hello']] l[5][2] = "goodbye" print(l) # Output: [3, 7, 7, 78, 12, [1, 4, 'goodbye']]