Skip to content

Category Archives: Python-Quizzes

Question 23:Find the output of the following program: dictionary = {}  dictionary[1] = 1 dictionary['1'] = 2 dictionary[1] += 1    sum = 0 for… Read More
Question 22:Find the output of the following program: a ={}  a['a']= 1 a['b']=[2, 3, 4]  print(a)  (A) {‘b’: [2], ‘a’: 1} (B) {‘a’: 1, ‘b’:… Read More
Question 21:Find the output of the following program: test = {1:'A', 2:'B', 3:'C'}  del test[1]  test[1] = 'D' del test[2]  print(len(test))  (A) Error (B) 0… Read More
Question 20:Find the output of the following program: a = {}  a[1] = 1 a['1'] = 2 a[1]= a[1]+1 count = 0 for i in… Read More
Question 19:Find the output of the following program: dictionary ={1:"geek", 2:"for", 3:"geeks"}  del dictionary  (A) del deletes the entire dictionary (B) del doesn’t exist for… Read More
Question 18:Find the output of the following program: dictionary = {"geek":10, "for":45, "geeks": 90}  print("geek" in dictionary)  (A) 10 (B) False (C) True (D) Error… Read More
Question 17:Find the output of the following program: d1 = {"john":40, "peter":45}  d2 = {"john":466, "peter":45}  print (d1 > d2)  (A) True (B) False (C)… Read More
Question 16:Find the output of the following program: numberGames = {}  numberGames[(1,2,4)] = 8 numberGames[(4,2,1)] = 10 numberGames[(1,2)] = 12    sum = 0 for… Read More
Question 15:Find the output of the following program: temp = {'GFG' : 1,          'Facebook' : 2,          'Google' : 3         }  for (key, values) in temp.items(): … Read More
Question 14:Find the output of the following program: temp = dict()  temp['key1'] = {'key1' : 44, 'key2' : 566}  temp['key2'] = [1, 2, 3, 4] … Read More
Question 13:Find the output of the following program: dictionary1 = {'GFG' : 1,              'Google' : 2,              'GFG' : 3             }  print(dictionary1['GFG']);  (A) Compilation error due… Read More
Question 12:Find the output of the following program: dictionary1 = {'Google' : 1,              'Facebook' : 2,              'Microsoft' : 3             }  dictionary2 = {'GFG' : 1, … Read More
Question 11:Find the output of the following program: dictionary = {'GFG' : 'geeksforgeeks.org',              'google' : 'google.com',              'facebook' : 'facebook.com'             }  del dictionary['google'];  for key, values… Read More
Question 10:Find the output of the following program: Which of these about a dictionary is false? (A) The values of a dictionary can be accessed… Read More
Question 9:Find the output of the following program: a = {'geeks' : 1, 'gfg' : 2}  b = {'geeks' : 2, 'gfg' : 1}  print… Read More