下面代码的执行结果是 ls=[’’2020’’,’’20.20’’,’’Python’’] ls.append(2020) ls.append([2020,’’2020’’]) print(ls)

admin2019-08-30  37

问题 下面代码的执行结果是
ls=[’’2020’’,’’20.20’’,’’Python’’]
ls.append(2020)
ls.append([2020,’’2020’’])
print(ls)

选项 A、[’2020’,’20.20’,’Python’,2020,2020,’2020’]
B、[’2020’,’20.20’,’Python’,2020]
C、[’2020’,’20.20’,’Python’,2020,[2020,’2020’]]
D、[’2020’,’20.20’,’Python’,2020,[’2020’]]

答案C

解析 列表的append方法实现在列表的最后增加一个元素。
转载请注明原文地址:https://kaotiyun.com/show/0P6p777K
0

最新回复(0)