LearnPy Hub
← Classes & Objects problems
Hard

Bank Queue

Write a Queue class with enqueue, dequeue and len. Read commands join NAME or serve; for serve print Serving NAME or Queue empty. Finally print the people still waiting, or nobody.

Input

n, then n commands.

Output

Messages, then the waiting list.

Sample 1

Input
4
join Mim
join Rafi
serve
join Sara
Output
Serving Mim
Rafi Sara

Sample 2

Input
1
serve
Output
Queue empty
nobody
solution.py
Output appears here
Bank Queue · Python practice problem · LearnPy Hub