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


Groups > comp.lang.python > #39998

Re: nested loops

Path csiph.com!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!newsfeed2.funet.fi!newsfeeds.funet.fi!news.cc.tut.fi!not-for-mail
From Anssi Saari <as@sci.fi>
Newsgroups comp.lang.python
Subject Re: nested loops
Date Tue, 26 Feb 2013 21:39:42 +0200
Lines 15
Message-ID <vg338wirhj5.fsf@coffee.modeemi.fi> (permalink)
References <mailman.2537.1361871951.2939.python-list@python.org>
NNTP-Posting-Host 2001:708:310:3430:dc0d:6429:26a3:43ac
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace news.cc.tut.fi 1361907582 26824 2001:708:310:3430:dc0d:6429:26a3:43ac (26 Feb 2013 19:39:42 GMT)
X-Complaints-To abuse@tut.fi
NNTP-Posting-Date Tue, 26 Feb 2013 19:39:42 +0000 (UTC)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock sha1:qYlntrHw1G/Izg5Zt+qJDDhHw+o=
Xref csiph.com comp.lang.python:39998

Show key headers only | View raw


leonardo <tampucciolina@libero.it> writes:

> 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!

You could use the repetition operator * since you have the number of
repetitions needed in i. Alternatively, considering the subject, you'd
just add another for loop to print the stars and spaces.

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


Thread

nested loops leonardo <tampucciolina@libero.it> - 2013-02-25 23:46 +0100
  Re: nested loops Alister <alister.ware@ntlworld.com> - 2013-02-26 14:36 +0000
  Re: nested loops Anssi Saari <as@sci.fi> - 2013-02-26 21:39 +0200
    Re: nested loops "K. Elo" <maillists@nic.fi> - 2013-02-27 09:02 +0200

csiph-web