Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Choose a list, a tuple, a set or a dictionary for each, and give a reason in one sentence.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. Use the three questions: position or name? Fixed or changing? Order and repeats?
Check. For each answer, ask: does another container fit better? The scores could be a tuple if the game were over and could not change, but a list is more natural while the game goes on.
Answer: tuple, set, dictionary, list, set.
Log in to join the discussion.
Loading…