想在mydict={'key1':1}中添加一个元素 'key2':2应该:
A: mydict.append('key2':2)
B: mydict.insert(0,{'key2':2})
C: mydict['key2']=2
D: mydict.pop()
A: mydict.append('key2':2)
B: mydict.insert(0,{'key2':2})
C: mydict['key2']=2
D: mydict.pop()
举一反三
- 如果有H(key)=key mod 13,若:key1=12,key2=25,那么key1与key2是同义词。
- 下面的SQL哪些有可能经过两个阶段(只经过一次shuffle)就计算出结果:( ) A: SELECT key1, key2, SUM(value1) FROM (SELECT key1, key2, COUNT(*) FROM dual GROUP BY key1, key2) t1 GROUP BY key2, key1; B: SELECT a.key1, a.key2 FROM table1 a JOIN table2 b ON a.key1 = b.key; C: SELECT *, ROW_NUMBER() OVER(PARTITION BY key ORDER BY value1, value 2) id1, ROW_NUMBER() OVER(PARTITION BY key ORDER BY value1) id2 FROM dual;
- D = {'苹果': 4, '梨': 5, '榴莲': 1} D2 = {'香蕉': 3, '柠檬': 3, '凤梨':2 , '苹果':3} for key in D: for key2 in D2: if key == key2: print(D[key]+D2[key2]) 以上代码运行结果为( )? A: 10 B: 5 C: 7 D: 21
- 对不同的关键字可能得到同一哈希地址,即key≠key2而H(key1)=H(key2)这种现象称冲突。(). A: 对 B: 错
- Planning in advance is the key to 2) .