Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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: OK 0.116 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.80; '*S*': 0.03; 'received:192.168.1.101': 0.09; 'cc:addr:python-list': 0.10; '"*"': 0.16; "'))": 0.16; '-1):': 0.16; 'result:': 0.16; 'row': 0.16; 'wrote:': 0.17; 'everyone,': 0.17; 'import': 0.21; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'url:mailman': 0.29; 'url:python': 0.32; 'help,': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'thanks': 0.34; 'url:org': 0.36; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'url:mail': 0.40; '2013': 0.84; 'beside': 0.84; 'blast': 0.84; 'off!': 0.84; 'received:212.52.84': 0.84; 'received:libero.it': 0.84; 'stars': 0.84; 'received:212.52': 0.91 X-CTCH-Spam: Unknown X-CTCH-RefID: str=0001.0A0C0207.512C88F1.0061,ss=1,re=0.000,fgs=0 X-libjamoibt: 1823 Date: Tue, 26 Feb 2013 11:05:20 +0100 From: leonardo User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Sven Subject: Re: nested loops References: <512BE9B3.7080409@libero.it> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070908040708080904070504" Cc: python-list 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: 159 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361873139 news.xs4all.nl 6905 [2001:888:2000:d::a6]:49753 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39941 This is a multi-part message in MIME format. --------------070908040708080904070504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > 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 --------------070908040708080904070504 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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> 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

--------------070908040708080904070504--