πŸ“Š Python
Q. What is the output of this code?
Code:
a = {1, 2, 3}
a.add(2)
print(a)
  • (A) {1, 2, 3}
  • (B) {1, 2, 3, 2}
  • (C) {1, 2}
  • (D) {2, 2, 3}
πŸ’¬ Discuss
βœ… Correct Answer: (A) {1, 2, 3}

Explanation: Sets do not allow duplicate values; `2` is already present.

Explanation by: Mr. Dubey
Sets do not allow duplicate values; `2` is already present.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
64
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
99%
Success Rate