goto, cls, wait commands

BOOGIEMAN BOOGIEMANPN at YAHOO.COM
Thu Feb 10 16:06:08 EST 2005


OK, thanks all
Here's presentation of my advanced programming skills :)
----------------------------------------
import os
import time

os.system("cls")

number = 78
guess = 0

while guess != number:
    guess = input("Guess number: ")
      
    if guess > number:
        print "Lower"
        time.sleep(3)
        os.system("cls")

    elif guess < number:  
        print "Higher"
        time.sleep(3)
        os.system("cls")

print "That's the number !"
---------------------------------------
BTW, I'm thinking to replace lines "time.sleep(3)"
with something like "Press any key to guess again"
How do I do that ?

Also I wanted to put at the end something like
"Do you want to guess again ?" and then "GOTO" start
of program, but since there is no such command in Python
what are my possible solutions ?




More information about the Python-list mailing list