πŸ“Š Python
Q. What is the output of the following code when executed in Python shell?
Code:
>>> d = {1,2,3}
>>> d.intersection_update({2,3,4,5})
>>> d
  • (A) {2,3}
  • (B) Error, duplicate element in the list
  • (C) {1,4,5}
  • (D) Error, no method called intersection_update
πŸ’¬ Discuss
βœ… Correct Answer: (A) {2,3}

Explanation: The intersection_update method returns a set that contains the intersection of the two sets.

Explanation by: Tanmay
The intersection_update method returns a set that contains the intersection of the two sets.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
175
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Tanmay
Publisher
πŸ“ˆ
85%
Success Rate