πŸ“Š Python
Q. What is the output of the following code?
Code:
print(len({'a':1,'b':2,'c':3}))
  • (A) 3
  • (B) 6
  • (C) 2
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3

Explanation: len() on a dictionary returns the number of keys, which is 3 here.

Explanation by: Ankit Singh
len() on a dictionary returns the number of keys, which is 3 here.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
42
Total Visits
πŸ“½οΈ
4 mo ago
Published
πŸŽ–οΈ
Ankit Singh
Publisher
πŸ“ˆ
91%
Success Rate