Join, leave: first in, first out · in code: Queues (Enqueue and Dequeue)
Uses a list as a queue, like a line at a counter: enqueue joins the back, dequeue serves the front. The first one in is the first one out.
line = []."Arun" (for Enqueue).next (for Dequeue and Peek).Open it in the editor, press Run, then change it and run it again.
line = []"Serving " + next"Still waiting: " + join(line)Serving ArunStill waiting: Priya, Kavinline = []line.append("Arun")line.append("Priya")line.append("Kavin")next = line.pop(0)print("Serving " + next)print("Still waiting: " + ", ".join(line))length(line) > 0 first, or Repeat While it's more than 0.