Class-12: Computer Science | Stack Program in Python | CBSE Board question 2023
A list contains following record of customer: [CBSE 2023]
[Customer_name, Room Type]
Write the following user defined functions to perform, given operations on the stack named ‘Hotel’:
(i) Push_ Cust () - To Push customers' names of those customers who are staying in 'Delux' Room Type.
(ii) Pop_ Cust () - To Pop the names of customers from the stack and display them. Also, display ''Underflow" when there are no ' customers in the stack.
For example:
If the lists with customer details are as follows:
["Siddarth", "Delux"]
["Rahul", "Standard"]
["Jerry", "Delux" ]
The stack should contain
Jerry
Siddharth
The output should be:
Jerry
Siddharth
Underflow