下面哪一个是错误的? A.使用len(列表名)测量元素的个数names_list=["zhangsan","lisi","wangwu"]print(len(names_list))B.使用列表名[下标]获取列表的某个元素,例如:names_list=["zhangsan","lisi","wangwu"]print(names_list[2])C.向列表中添加新元素有三个方法:append、extend、insert,例如:names_list=["zhangsan","lisi","wangwu"]names_list.append("zhaoliu")names_list.extend(["zhaoliu","liqi"])names_list.insert(1,"zhaoliu")print(names_list)D.已有列表nums=[11,22,33,44,55],使用while循环遍历列表nums=[11,22,33,44,55]i=0 whileiprint(nums[i])i+=1
下面哪一个是错误的?
A.使用len(列表名)测量元素的个数names_list=["zhangsan","lisi","wangwu"]print(len(names_list))
B.使用列表名[下标]获取列表的某个元素,例如:names_list=["zhangsan","lisi","wangwu"]print(names_list[2])
C.向列表中添加新元素有三个方法:append、extend、insert,例如:names_list=["zhangsan","lisi","wangwu"]names_list.append("zhaoliu")names_list.extend(["zhaoliu","liqi"])names_list.insert(1,"zhaoliu")print(names_list)
D.已有列表nums=[11,22,33,44,55],使用while循环遍历列表nums=[11,22,33,44,55]i=0 whilei
print(nums[i])i+=1
相关考题:
单选题指出下面哪组俞募配穴是错误的()A肺俞云门B肝俞期门C脾俞章门D肾俞京门E胆俞日月