This topic is READ ONLY
FrEaK (1) [Avatar] Offline
#1
Here is how I solved this problem without a nested loop! Just be sure to tab the for loop block code!


import time

cdtime = int(raw_input("How many seconds? "))
stars = cdtime

for i in range (cdtime, 0, -1):

print i, (stars * "*")
time.sleep(1)
stars = stars - 1

print "Blast off!"
warren.sande (211) [Avatar] Offline
#2
Re: Chap. 11 Prob. 2 Different Soloution
Good One! You used the same trick we showed in Chapter 1:

print "hello" * 20

Nice to see you remembered that and made the connection to this problem.


Regards,
Warren Sande