Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #39941

Re: nested loops

Date 2013-02-26 11:05 +0100
From leonardo <tampucciolina@libero.it>
Subject Re: nested loops
References <512BE9B3.7080409@libero.it> <CAEH=cXUTM0V30McQP3-e1U_WrXh_GEzjZP4099ERd-i3SNno7Q@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2539.1361873139.2939.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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@libero.it 
> <mailto:tampucciolina@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: nested loops leonardo <tampucciolina@libero.it> - 2013-02-26 11:05 +0100

csiph-web