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
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
17 Sep, 2020
Like Article
Save Article