-3

I've been trying to do it for the past hour but I'm confused about it. This is what I've been trying so far but it doesn't seem to work no matter what I try.

def main():
    q = queue.Queue()
    name = input("Enter the person's name: ")
    q.enqueue(name)

main()
martineau
  • 119,623
  • 25
  • 170
  • 301

1 Answers1

1

The enqueue method in python is called put() that does a q.enqueue(). Also make sure you are importing the Queue class with an import queue.

martineau
  • 119,623
  • 25
  • 170
  • 301
RedKnite
  • 1,525
  • 13
  • 26