names = ["Peiqi","Black"]numbers = [1,2,3]names.extend(numbers) # extend()方法表示合并print(names)代码的执行结果是_________.
举一反三
- names = ["Lihua","Rain","Jack","Xiuxiu","Peiqi","Black"]names.insert(-1,"Peiqi")print(names.index("Peiqi"))
- 下面代码的执行结果是()。ls=[[1,2,3],[[4,5],6],[7,8]]print(len(ls)) A: 1 B: 2 C: 3 D: 8
- Python语句 a=[1,2,3,None,[[]],[]] print(len(a)) 以上代码的运行结果是( )
- 下面代码的执行结果是()。 ls=[[1,2,3],[[4,5],6],[7,8]]print(len(ls))
- 对一个列表里的数据进行奇偶数分离 numbers = [12, 37, 5, 42, 8, 3] even = [] odd = [] while len(numbers) > 0 : number = ( ) if(number % 2 == 0): even.append(number) else: odd.append(number) print even print odd