MulaiMulai sekarang secara gratis

Using Python's SimpleQueue

In this exercise, you will work with Python's SimpleQueue(). You will create a queue called my_orders_queue to add the orders of a restaurant and remove them from it when required.

Latihan ini adalah bagian dari kursus

Data Structures and Algorithms in Python

Lihat Kursus

Petunjuk latihan

  • Create the queue.
  • Add an element to the queue.
  • Remove an element from the queue.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

import queue

# Create the queue
my_orders_queue = queue.____()

# Add an element to the queue
my_orders_queue.____("samosas")

# Remove an element from the queue
my_orders_queue.____()
Edit dan Jalankan Kode