data-structures-algorithms-python icon indicating copy to clipboard operation
data-structures-algorithms-python copied to clipboard

Infinite Loop in food_ordering_system.py

Open slayer321 opened this issue 4 years ago • 1 comments

There is an error in the dequeue method in the Queue class as when I'm running this program food_ordering_system.py . I'm getting an infinite loop

Placing order for: samosa
Placing order for:Now serving:  pizza
 pasta
Placing order for: biryani
Placing order for: burger
Now serving:  samosa
Now serving:  pasta
Now serving:  biryani
Now serving:  burger
Queue is empty
Now serving:  None
Queue is empty
Now serving:  None
Queue is empty
Now serving:  None
Queue is empty
Now serving:  None
Queue is empty
Now serving:  None
Queue is empty
Now serving:  None 

and it goes on I think this error can be solved by using the try and except block I'm new to open source and trying to make my contribution. I will work on this issue. can you guide me?

slayer321 avatar Apr 09 '21 10:04 slayer321

got the solution I'm going to PR please do merge it

slayer321 avatar Apr 09 '21 10:04 slayer321