Challenge: Automated Bus Announcements
Taak
Swipe to start coding
If you've ever ridden a bus or tram, you know that station announcements are pre-recorded and cycle continuously. Implement a generator function bus_announcements
to simulate an automated bus announcement system.
- Use an infinite loop to cycle through the stops continuously.
- Iterate over each stop in the
stops
list. - Use
yield
to return the current stop in the format"Next stop: {stop}"
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 4. Hoofdstuk 5
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 4.35
Challenge: Automated Bus Announcements
Veeg om het menu te tonen
Taak
Swipe to start coding
If you've ever ridden a bus or tram, you know that station announcements are pre-recorded and cycle continuously. Implement a generator function bus_announcements
to simulate an automated bus announcement system.
- Use an infinite loop to cycle through the stops continuously.
- Iterate over each stop in the
stops
list. - Use
yield
to return the current stop in the format"Next stop: {stop}"
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Awesome!
Completion rate improved to 4.35Sectie 4. Hoofdstuk 5
single