nested loops

leonardo tampucciolina at libero.it
Tue Feb 26 05:05:20 EST 2013


thanks for the help, it works


Il 26/02/2013 10.58, Sven ha scritto:
> Here's one solution
>
> import time
> count_timer = int(raw_input('how many seconds?: '))
> for i in range(count_timer, 0, -1):
> ||print i,
>     print "*" * i
>     time.sleep(1)
> print 'blast off!'
>
>
> On 25 February 2013 22:46, leonardo <tampucciolina at libero.it 
> <mailto:tampucciolina at libero.it>> wrote:
>
>     hi everyone,
>
>     i have the following program:
>
>     import time
>     count_timer = int(raw_input('how many seconds?: '))
>     for i in range(count_timer, 0, -1):
>         print i
>         time.sleep(1)
>     print 'blast off!'
>
>
>     this is the result:
>
>     how many seconds?: 5
>     5
>     4
>     3
>     2
>     1
>     blast off!
>
>     how can i have it print  a row of stars beside each number, like
>     this?:
>
>     how many seconds?: 5
>     5 * * * * *
>     4 * * * *
>     3 * * *
>     2 * *
>     1 *
>     blast off!
>
>
>     -- 
>     http://mail.python.org/mailman/listinfo/python-list
>
>
>
>
> -- 
> ./Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130226/242f3295/attachment.html>


More information about the Python-list mailing list