![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
[单选题]
已知列表lst=[1,2,3],则分别执行以下代码,结果为[1,4,9]的是()
A.for i in lst: i=i**2 print(lst)
B.for i in range(0,3): lst[i]**=2 print(lst)
C.for i in range(0,3): lst[i]=i**2 print(lst)
D.for i in range(0,3): lst[i]+=lst[i] print(lst)
查看答案
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
A.for i in lst: i=i**2 print(lst)
B.for i in range(0,3): lst[i]**=2 print(lst)
C.for i in range(0,3): lst[i]=i**2 print(lst)
D.for i in range(0,3): lst[i]+=lst[i] print(lst)
A.[i[::-1] for i in lst]
B.[(i[1],i[0]) for i in lst]
C.[(v,k) for k,v in lst]
D.[i[1]+i[0] for i in lst]