Hi, I’m currently working on my mini project to build a simulation of queue system in bank. The goals of this program is to be able to divide right amount of queue for each teller, so none teller has longer queue than other tellers.
Here is glimpse of my code:
queue_dict = {'Angel':[],
'Mellysa':[],
'David':[],
'Thom':[],
'Monica':[]
}
queue_no = 0
while True:
queue_no += 1
customer_name = input("Enter your name: ")
if customer_name == '':
break
#Find the teller that has lowest number of queue
lowest_queue = np.inf
for teller_name, customers_queue in queue_dict.items():
if len(customers_queue)<lowest_queue:
lowest_queue = len(customers_queue)
chosen_teller = teller_name
# Get the customer on the queue of the chosen teller
queue_dict[chosen_teller].append(customer_name)
print(f"{customer_name}, please go the teller {chosen_teller}")
print()
My question is, from my code above, can someone help me If i want to create a code to select the very first and last customer?