Coding Challenge: Carousel
Learn how to write a program that mimics the working of a carousel.
We'll cover the following
Try to code each exercise twice, once with a while
loop and the other with a for
, to see for yourself which one is the most appropriate.
Problem statement
Write a program that launches a carousel for 10 turns, showing the turn number each time.
Expected output
Turn number: 1
Turn number: 2
Turn number: 3
Turn number: 4
Turn number: 5
Turn number: 6
Turn number: 7
Turn number: 8
Turn number: 9
Turn number: 10
Coding exercise
Get hands-on with 1400+ tech skills courses.