Ask coding questions

← Back to all posts
Python time.sleep

Hey everyone!
I had a Python programming lesson for today in which I was challenged to create a Queue in the following format..

Program a Queue so that:
-When you type in a name, it gets added to the end of the queue and the queue is displayed
-Every 10 seconds, the first name is removed from the queue and the updated queue is displayed
-If the name is that of an administrator, then their name goes to the front of the queue

I managed to do everything but the 10 second part. I initially tried something but it just delayed everything by 10 seconds when it got to it. Anyone got any idea on how to do this?


My bad for not making it clearer, I was told it had to be every 10 seconds in the background while the main program of inserting names and etc runs


You should probably put the delay at the end of the loop