Countdown from 2 minutes - how?

Fredrik Lundh fredrik at pythonware.com
Thu Mar 30 08:41:20 EST 2006


henrik at wollesens.dk wrote:

> Can anyone tell me the python code for a simple countdown from eg. 2.00
> minutes.
>
> It should be printet out to the screen.
> When it is finished it should write "Time is up"

here's a first version:

    import time
    time.sleep(2*60)
    print "Time is up"

to improve this, I suggest reading the chapter on loops in the tutorial:

    http://docs.python.org/tut/node6.html

</F> 






More information about the Python-list mailing list