The program demonstrates how to remove elements from a set in Python using the pop method.
In this program, the pop method is used to remove an arbitrary element from the set. It is important to note that the pop method removes an arbitrary element, not a specific element, and that sets are unordered, so the specific element that is removed cannot be predicted.
n = {30,50,70,20,30,60} print("Before removing From Set :",n) n.pop() print("After removing From Set :",n)
Before removing From Set : {50, 20, 70, 60, 30} After removing From Set : {20, 70, 60, 30}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions