Skip to content
KALANBLON
Show contents

Chapter 3 of 7 · 10 min

Quiz: store and find

Stacks, queues, dictionaries and sets: check that you can pick the right structure. You need 70% correct answers to pass this quiz.

Quiz

7 questions · pass mark: 70%

  1. 1.A program's “Undo” button undoes the last action first. Which structure does it use?

    One answer

  2. 2.To serve customers in their order of arrival, which Python approach fits best?

    One answer

  3. 3.Complete to remove the first item of the queue.

    Complete the code

    from collections import deque
    queue = deque(["Awa", "Kofi"])
    served = queue.____()
  4. 4.Why is looking up a key in a dictionary almost instant?

    One answer

  5. 5.Which of these values can be dictionary keys? (several answers)

    Several answers possible

  6. 6.What is len(set(["rice", "millet", "rice", "rice"]))?

    One answer

  7. 7.With python = {"Awa", "Kofi"} and web = {"Kofi", "Lina"}, what does python & web give?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.