The problem of "fruits" also can be solved in the way below:d = {} for item in fruits: d[item] = d.___________(item, 0) + 1
举一反三
- 程序运行结果为(______ )fruit = ['apple', 'banana', 'mango', 0]for item in fruit: if item == 0: fruit[item] = 'watermelon' elif item == 'mango': fruit[2] = 'pear'print(fruit)
- 有列表定义如下:[br][/br]group1 = [ ["萧峰", 98], ["杨过", 96] ] 要提取两位大侠的名字"萧峰"和"杨过",应该采用下面哪种方法 A: n = [ item[0] for item in group1 ] B: n =[ item[1] for item in group1 ] C: n = group1[0],group1[1] D: n = [ item for item in group1 ]
- The most effective complaint can be made by ________. A: showing the faulty item to the manufacturer B: explaining exactly what is wrong with the item C: saying firmly that the item is of poor quality D: asking politely to change the item
- 开启第二条生产线的标准() A: 早餐ITEM数≥280/午餐ITEM≥241 B: 早餐ITEM数≥281/午餐ITEM≥240 C: 早餐ITEM数≥241/午餐ITEM≥280 D: 早餐ITEM数≥200/午餐ITEM≥180
- 以下语句获取表中第1行第1列(FirstName列)的数据,其中正确的语句是()。 A: AmyTable.Rows(0)(1) B: BmyTable.Rows(0).Item(1) C: CmyTable.Rows(0).Item(0) D: DmyTable.Rows(1)("FirstName") E: EmyTable.Rows(0).Item("FirstName")