Which of the following can be used as a dictionary key?
|
![]() ![]() ![]() ![]() |
Which of the following about dictionary keys is NOT correct?
|
![]() ![]() ![]() ![]() |
Which of the following will NOT create an empty dictionary?
|
![]() ![]() ![]() ![]() |
What would be the result of executing the following code?
f={'Fr':33,'Br':55,'UK':44} sorted(f) |
![]() ![]() ![]() ![]() |
Two dictionaries, d1 and d2, were created as shown below:
d1 = {'p':1, 'q':2} d2 = {'q':3, 'r':4}
Which of the following code snippet(s) would merge d1 and d2 into a new dictionary, d3, that will have {'q': 2, 'r': 4, 'p': 1} as its data
|
![]() ![]() ![]() ![]() |
Which line of code should replace # Replace this line in the following code snippet to get the result:
P-y-t-h-o-n! w = 'Python' d = {'sep':'-', 'end':'!'} # Replace this line |
![]() ![]() ![]() ![]() |
What would be the output of executing the following code?
d, e, f = {},dict(),dict(()) d['a'] = 1.0; d['b'] = 2.0; d['c'] = 3.0 e = dict([('b',2/1), ('c',3/1), ('a', 1/1)]) f = dict(zip(['c','a','b'], [3, 1, 2])) print(d==e and e==f and d==f) |
![]() ![]() ![]() ![]() |
Which of the following dictionary methods can extract key:value pairs from a dictionary?
|
![]() ![]() ![]() ![]() |
Which of the following is the difference between a dictionary (dict) and a list?
|
![]() ![]() ![]() ![]() |
Which line of code should replace # Replace this line in the following code snippet to get 3 as the output to show the count of key:value pairs in dictionary t
t={'Fr':33,'Br':55,'UK':44} # Replace this line |
![]() ![]() ![]() ![]() |