Try it out

1 Remember the countdown-timer program we created in chapter 8? Here it is, to refresh your memory: import time for i in range (10, 0, -1): print i time.sleep(1) print "BLAST OFF!"

Modify the program to use a variable loop. The program should ask the user where the countdown should start, like this:

Countdown timer:

How many

seconds? 4

4

3

2

1

BLAST OFF!

Take the program you wrote in question #1, and have it print a row of stars beside each number, like this:

Countdown timer:

How many

seconds? 4

4 * * * *

3 * * *

2 * *

1 *

BLAST OFF!

(Hint: You probably need to use a nested loop.)

CHAPTER 12

Was this article helpful?

0 0
100 Bowling Tips

100 Bowling Tips

Playing bowling with your friends can help you decide if it is indeed the hobby that you want to invest your time on today. Aside from that, it can help you get a better feel of the sport. More importantly, when you play with your friends, it would become a more fun activity, which you can look forward to each week.

Get My Free Ebook


Post a comment