πŸ“Š Python
Q. What is the output of the following program?
Code:
D = dict()
for x in enumerate(range(2)):
D[x[0]] = x[1]
D[x[1]+7] = x[0]
print(D)
  • (A) KeyError
  • (B) {0: 1, 7: 0, 1: 1, 8: 0}
  • (C) {0: 0, 7: 0, 1: 1, 8: 1}
  • (D) {1: 1, 7: 2, 0: 1, 8: 1}
πŸ’¬ Discuss
βœ… Correct Answer: (C) {0: 0, 7: 0, 1: 1, 8: 1}

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
227
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
97%
Success Rate