• 2022-06-07
    list=["a",1,"b",2]del list[1:3]print(list)
    A: ('a', 2)
    B: ['a']
    C: ['a', 2]
    D: ['a', 'b']
  • C

    内容

    • 0

      程序段如下: x=[1,2,3] y=["a","b","c"] print(list(zip(x,y)))print函数输出的结果是( ) A: [( 'a':1), ('b:2), ('c':3)] B: [(1,2,3),("a","b","c")] C: [(1, 'a'), (2, 'b'), (3, 'c')] D: [{1:'a'}, {2:‘b'}, {3:'c'}]

    • 1

      下面程序的运行结果为()def swap(list): temp=list[0] list[0]=list[1] list[1]=templist=[1,2]swap(list)print(list) A: [1,2] B: [2,1] C: [1,1] D: [2,2]

    • 2

      请写出下列语句的运行结果:>>>list=['a','b','c','d']>>>print(list[1:3])

    • 3

      如下程序的输出结果是:L1 =[‘abc’, [‘123’,‘456’]]L2 = [‘1’,‘2’,‘3’]print(L1 >; L2) A: False B: TypeError: ‘>;’ not supported between instances of ‘list’ and ‘str’ C: 1 D: True

    • 4

      以下程序的输出结果是: L1 =['abc', ['123','456']] L2 = ['1','2','3'] print(L1 > L2) A: TypeError: '>' not supported between instances of 'list' and 'str' B: False C: True D: 1