LearnFrenzy
Sign in Take a free test

Sets · Sets MCQ · Question 9

1, True and 1.0 in a set Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 9 Back to Exercise

What is len({1, True, 1.0})?

  • A 3
  • B 2
  • C 1 Correct
  • D TypeError
Correct Answer: Option C

1 == True == 1.0 and their hashes are equal, so the set treats them as one element (keeping the first, 1).

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links