ProgrammingHardTCS NQT · Wipro pattern
What is printed?
What is printed?
print(set('mississippi') == set('misp'), len(set('mississippi')))- A. True 4
- B. False 4
- C. True 5
- 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
- What is printed? python print(0.1 3 == 0.3, abs(0.1 3 - 0.3) < 1e-9)
- What is printed? python a = [1, 2, 3] print(a[3:], a[1:10], a[-10:1])
- What is printed? python print(len(bytes('é', 'utf-8')), len('é'))
- What is printed? python print(float('inf') > 10308, -float('inf') < -10308)
- What is printed? python print(sorted({3: 'a', 1: 'b'}), list(reversed(sorted({3: 'a', 1: 'b'}))))
- What is printed? python print('a' < 'B', 'a'.upper() < 'B')