Display the Doubles (Exercise)
00:00
The next exercise is to display the doubles. Write a function called doubles()
That takes a number as its input and doubles it. Then use doubles()
in a loop to double the number 2
three times, displaying each result on a separate line.
00:18
So when you solve the exercise and run your code, then the output should be 4
, 8
, and 16
.
00:26 You can pause the video, take your time, and once you’re ready, move on to the next lesson, where you’ll see how I solve this exercise.
Become a Member to join the conversation.