Advertisements
Advertisements
प्रश्न
A list containing records of products as
L = [("Laptop", 90000), ("Mobile", 30000), ("Pen", 50), ("Headphones", 1500)]
Write the following user-defined function to perform an operation on a stack named Product to:
Pop_element() – To pop the items from the stack and display them. Also, display "Stack Empty" when there are no elements in the stack.
Output:
('Headphones', 1500)
('Mobile', 30000)
('Laptop', 90000)
Stack Emplyकोड लेखन
Advertisements
उत्तर
def Pop_element(product):
while product:
print(product.pop())
else:
print("Stack Emply")shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
