Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Python Quizzes
→
Data Type in Python Quizzes
→
Question 8:Find the output of the following progra...
1.
Question 8:Find the output of the following program:dict ={}print (all(dict))(A) { }(B) False(C) True(D) An exception is thrown
Answer»
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
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(C) 1(D) 2
Question 13:Find the output of the following program:dictionary1 = {'GFG' : 1,'Google' : 2,'GFG' : 3}print(dictionary1['GFG']);(A) Compilation error due to duplicate keys(B) Runtime time error due to duplicate keys(C) 3(D) 1
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 the dictionary(C) del deletes the keys in the dictionary(D) del deletes the values in the dictionary
Question 20:Find the output of the following program:a = {}a[1] = 1a['1'] = 2a[1]= a[1]+1count = 0for i in a:count += a[i]print(count)(A) 2(B) 4(C) 1(D) Error
Question 15:Find the output of the following program:temp = {'GFG' : 1,'Facebook' : 2,'Google' : 3}for (key, values) in temp.items():print(key, values, end = " ")(A) Google 3 GFG 1 Facebook 2(B) Facebook 2 GFG 1 Google 3(C) Facebook 2 Google 3 GFG 1(D) Any of the above
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
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) Compilation Error(D) TypeError
Question 22:Find the output of the following program:a ={}a['a']= 1a['b']=[2, 3, 4]print(a)(A) {‘b’: [2], ‘a’: 1}(B) {‘a’: 1, ‘b’: [2, 3, 4]}(C) {‘b’: [2], ‘a’: [3]}(D) Error
Question 16:Find the output of the following program:numberGames = {}numberGames[(1,2,4)] = 8numberGames[(4,2,1)] = 10numberGames[(1,2)] = 12sum = 0for k in numberGames:sum += numberGames[k]print (len(numberGames) + sum)(A) 33(B) 12(C) 10(D) 8
Question 14:Find the output of the following program:temp = dict()temp['key1'] = {'key1' : 44, 'key2' : 566}temp['key2'] = [1, 2, 3, 4]for (key, values) in temp.items():print(values, end = "")(A) Compilation error(B) {‘key1’: 44, ‘key2’: 566}[1, 2, 3, 4](C) Runtime error(D) None of the above
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies