1 以下代码的输出结果为:
print(round(-3.6))
A.-4 B.-4.0 C.-3 D. -3.0
2 以下代码的输出结果为(Python3.6及以上):
dic={ 'a':1,'b':4,'c':9,'xy':13} print(dic.popitem())
A.(‘a’:1,‘b’:4,‘c’:9)
B.(‘c’:9,‘xy’:13)
C.(‘a’,13)
D.(‘xy’,13)
3 以下代码的输出结果为:
adict = dict.fromkeys(['key1', 'key2'], []) adict['key1'].append(123) adict['key1'] = 456 print(adict['key2'])
A.报错 B.[] C.[123] D. 456
4 以下代码的输出结果为:
print([1, 2] == [(1), (2)]) print([1, 2] == [(1,), (2,)])
A.True True B.True False C.False True D.False False
5 以下代码的输出结果为:
print('hi') if 3 > 4 else print('bye')
A.报错 B.hi C.bye D.hi bye
6 以下代码的输出结果为:
num = 6 if True == 1.0 else 8 print(num)
A.报错 B.6 C.8 D.