题目内容

以下程序的输出结果是:a = [[1,2,3], [4,5,6],[7,8,9]]s = 0for c in a:for j in range(3):s+= c[ j ]print(s) }

A. [1, 2,3,4,5,6,7,8,9]
B. 45
C. 24
D. 0

查看答案
更多问题

列表变量ls共包含10个元素,Is索引的取值范围是:

A. (0,10)
B. [0,10]
C. (1,10]
D. [0,9]

以下程序的输出结果是:CLis = list( range(5))print(5 in CLis)

A. True
B. False
C. 0
D. -1

以下程序的输出结果是:Is = ["apple" ," red" ," orange" ]def funC(a):ls. append(a)returnfunC(“ yellow " )print( ls )

A. [ ]
B. [“ apple” , “red” , “orange” ]
C. [ “ yellow” ]
D. [“apple ”, “red” , “orange” , “yellow” ]

下面的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])

答案查题题库