1.4 KiB
1.4 KiB
Hints
- Make sure you have a good understanding of how to create and update lists.
- The Python documentation on
listscan be really helpful. - The Python tutorial section on
listsis also a good resource.
1. Add Me to the queue
- An
if-elsestatement can help you find which ticket type you are dealing with. - You can then
append()the person to the queue based on the ticket type.
2. Where are my friends
- You need to find the
index()of the friend name from the queue.
3. Can I please join them?
- Since you know the
index(), you caninsert()the friend into the queue at that point.
4. Mean person in the queue
- You know the mean persons name, so you can
remove()them from the queue.
5. Namefellows
count()-ing the occurrences of thenamein the queue could be a good strategy here.
6. Remove the last person
- Although you could
remove()the person by name,pop()-ing them out might be quicker.
7. Sort the Queue List
- Don't forget that You need to avoid mutating the queue and losing its original order.
- Once you have a
copy(),sort()-ing should be straightforward. - We're looking for an ascending sort, or alphabetical from a-z.