πŸ“Š Python
Q. What is the output of the following program?
Code:
D = dict()
for i in range (3):
for j in range(2):
D[i] = j
print(D)
  • (A) {0: 0, 1: 0, 2: 0}
  • (B) {0: 1, 1: 1, 2: 1}
  • (C) {0: 0, 1: 0, 2: 0, 0: 1, 1: 1, 2: 1}
  • (D) TypeError: Immutable object
πŸ’¬ Discuss
βœ… Correct Answer: (B) {0: 1, 1: 1, 2: 1}

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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