Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: UNSURE 0.326 X-Spam-Level: *** X-Spam-Evidence: '*H*': 0.45; '*S*': 0.10; 'range.': 0.16; 'received:fi': 0.16; 'row': 0.16; 'sec': 0.16; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; '---': 0.26; 'actual': 0.28; 'writes:': 0.29; 'included': 0.29; 'print': 0.32; 'to:addr :python-list': 0.33; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'range': 0.60; 'received:62': 0.62; 'note:': 0.64; 'received:130': 0.75; 'upper': 0.75; 'beside': 0.84; 'blast': 0.84; 'off!': 0.84; 'stars': 0.84 Date: Wed, 27 Feb 2013 09:02:21 +0200 From: "K. Elo" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: nested loops References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 27 Feb 2013 11:02:00 +0100 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361959322 news.xs4all.nl 6905 [2001:888:2000:d::a6]:47394 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40044 Hi! > leonardo 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! --- snip --- sec = int(input("How many seconds? ")) for i in range(0,sec): print str(sec-i)+":"+" *"*(sec-i) print "blast off!" --- snip --- Please note: the value for the upper bound is not included in the range. In my example, the actual range is from 0 to 4. HTH, Kimmo