ProgrammingHardTCS NQT · Wipro pattern

What is printed?

What is printed?
print(set('mississippi') == set('misp'), len(set('mississippi')))
  1. A. True 4
  2. B. False 4
  3. C. True 5
  4. D. True 3

Correct answer: A. True 4

A set keeps each distinct character once, so the letters of mississippi are m, i, s and p. Both sets contain the same four letters.

More Python Programming questions

Exams that ask this topic