The Wayback Machine - https://web.archive.org/web/20220516133330/https://www.geeksforgeeks.org/python-quizzes-python-dictionary-quiz-question-15/
Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Python-Quizzes | Python Dictionary Quiz | Question 15

  • Last Updated : 17 Sep, 2020

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


Answer: (D)

Explanation: Dictionaries are unordered. So any key value pairs can be added at any location within a dictionary. Any of the output may come.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!