1. Home
  2. Data Science
  3. Python
  4. What will be the result of len({1, 2, 3, 4, 5}) in Python?

Added 4 May 2024

What will be the result of len({1, 2, 3, 4, 5}) in Python?

  1. 1
  2. 5 Correct answer
  3. 0
  4. Error

Correct answer

B. 5

15 views

MCQSEXAM

Explanation

The len() function returns the number of elements in a set, so the result is 5.

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs