🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

Python में set को जोड़ने के लिए कौन सी method प्रयोग होती है?

Which method is used to add an element to a set in Python?

A
add()
B
append()
C
insert()
D
extend()
Explanation
  • English:
    In Python, to add an element to a set, the method used is add().

  • हिंदी:
    Python में किसी set में element जोड़ने के लिए add() method का उपयोग किया जाता है।


🔹 Example / उदाहरण:

my_set = {1, 2, 3}
my_set.add(4)
print(my_set)  # Output: {1, 2, 3, 4}

Correct Answer: A) add()

Latest Updates