πŸ“Š Python
Q. What will the be the result of below Python code?
Code:
set1={1,2,3}

set1.add(4)

set1.add(4)

print(set1)
  • (A) {1,2,3,4}
  • (B) {1,2,3}
  • (C) {1,2,3,4,4}
  • (D) It will throw an error as same element is added twice
πŸ’¬ Discuss
βœ… Correct Answer: (A) {1,2,3,4}

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
145
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
89%
Success Rate