下面的d是一个字典变量,能够输出数字2的语句是:d = { 'food':{'cake':1,'egg’ :5} ,'cake' :2,'egg':3}
A. print( d[ ‘food'][ 'egg'])
B. print(d[ 'cake'])
C. print(d[‘ food'][ -1])
D. print(d[ 'cake'][1])
查看答案
以下程序的输出结果是:s = [4,2,9,1]s.insert(3,3)print(s)
A. [4,2,9,1,2,3]
B. [4,3,2,9,1]
C. [4,2,9,2,1]
D. [4,2,9,3,1]
ls = [2,“apple”,[42,“yellow”,“misd”],1.2],表达式ls[2][-1][2]的结果是:
A. m
B. i
C. s
D. d
以下程序的输出结果是:Lis1 = [1,2,[‘python’]]Lis2 =[‘ loves ’]Lis1[ 1 ] = lis2print(lis1) }
A. [ lis2 ,2,[ 'python'] ]
B. [1,[ 'loves'], [ 'python'] ]
C. [1,2, ‘python' ,’loves' ]
D. [1 ,2,[ 'python' ,'loves' ]
以下程序的输出结果是:List = [[0,1,2],“123.0”,“python”]a = all(list[0])b = list[1].split(“ . ”)c = ascii(list[2])print(a,b,c) }
A. True ['123'] 'python'
B. False ['0'] '1'
C. True ['123',‘0'] ‘1’
D. False ['123',0'] 'python'