When defining a dictionary in Python, which of the following will give you an error?单项选择题
A
my_phonebook = {('Lisa','Lee'):'(123)456-7890', ('Jennie', 'Kim'):'(321)654-0987'}
B
my_phonebook = {'Lisa':1234567890, 'Jennie':3216540987}
C
my_grade = {['A']:5, ['B']:3, ['C']:1}
D
my_grade = {'A':5, 'B':3, 'C':1}
E
None of the above
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Consider this Python code: If the user inputs 10, the console output will be: Nike: [Fill in the blank] Adidas: [Fill in the blank] Reebok: [Fill in the blank]
In Python, what is a dictionary?
Question1.4 What is the result of the following Python expression? 'UNSW' in {'university': ['UNSW', 'USYD']} Select one alternative: TypeError True KeyError False ResetMaximum marks: 2
Question at position 20 Which of the following lines of code will run, but then give a runtime error?dict = {"a": 3, "b": 2, "c":7}print(dict)dict = {"a": 3, "b": 2, "c":7}print(dict[a])dict = {"a": 3, "b": 2, "c":7}print(dict["a"])dict = {"a": 3, "b": 2, "ab":7}print(dict["a"+"b"])Clear my selection
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!