815 B
815 B
Hints
1. Generate seat letters
- The returned value should be of type
generator. - You can have a sequence of letters from
AtoDand cycle through them. - Use
yieldto return the next letter.
2. Generate seats
- The returned value should be of type
generator. - Row
13should be skipped, so go from12to14. - Keep in mind that the returned values should be ordered from low to high.
1A, 1B, 2A, ... - Here it might be good to reuse or call functions you have already defined.
3. Assign seats to passengers
- Make sure your seat numbers do not have any spaces in them.
- Here it might be good to reuse or call functions you have already defined.
4. Ticket codes
- You can use
len()to get the length of a string. - You can use
"<string>" * <int>to repeat a string.