2/4 下列选项中,哪一项可以把阿花加进列表 names ,排在老王之后?names = ['小明', '老王', '阿强']
A: names.append('阿花')
B: names.insert(2, '阿花')
C: names.insert(2, 阿花)
D: insert(names, 2, '阿花')
A: names.append('阿花')
B: names.insert(2, '阿花')
C: names.insert(2, 阿花)
D: insert(names, 2, '阿花')
举一反三
- 一个列表名为names,里面有old_driver,rain,jack,shanshan,peiqi,black_girl 元素, 以下用列表分片的方法访问前三个元素的语句正确的是: A: names[0:3] B: names[0:2] C: names[0:4] D: names[1:4]
- 一个列表名为names,里面有old_driver,rain,jack,shanshan,peiqi,black_girl 元素, 以下用列表分片的方法访问前三个元素的语句正确的是: A: names[0:3] B: names[0:2] C: names[0:4] D: names[1:4]
- names = ["Lihua","Rain","Jack","Xiuxiu","Peiqi","Black"]names.insert(-1,"Peiqi")print(names.index("Peiqi"))
- ‘Baby’, ‘darling’ and ‘sweety’ are all examples of names that lovers might call each other. What is the expression which refers to names used in this way? ( ) A: love names B: omance names C: close names D: pet names
- In Chinese names, given names come first while family names come last.