[Tutor] Value asign to random.randrange
gew75 at hotmail.com
Wed Jun 9 04:36:41 EDT 2004
number = random.randint(1,10) # number between 1 and 10
number = str(number) # for comparing the number and the user's guess
answer = ''
while answer != number:
answer = raw_input("What is your guess? ")
It has some flaws, but you can work those out ;).
----- Original Message -----
From: "Ivan low" <visional_freeman at yahoo.com>
To: <tutor at python.org>
Sent: Wednesday, June 09, 2004 6:01 PM
Subject: [Tutor] Value asign to random.randrange
> Hi, I was thinking to asign some value to the program,
> when random number was generated, that number will be
> a question that ask the user. I found it hard to asign
> number to my qustion. Does anybody know how to go
> about this?
> Tutor maillist - Tutor at python.org
More information about the Tutor