[prog] why doesn't this program work? (python)

Guru - haunter03 at hotmail.com
Thu Dec 19 15:19:11 EST 2002


I'm just a little confused on why this program does not work? (python)
The print functions are there to help me work out what is going wrong, it 
has to be something very simple that I'm missing...

#Plays the higher or lower game
#uses the time, seconds as the random no.
#the aim is to have a random no. assigned and have someone guess it....with
#them getting hints of higher and lower
#prob. is it doesn't exit the while loop when the correct no. is guessed....
from time import strftime
number = strftime("%S")
print number
guess = 0

while guess != number:
	guess = input("Guess a number: ")
	if guess < number:
		print "Too low"
	elif guess > number:
		print "Too high"

print "Just right :)"





_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




More information about the Programming mailing list