View Single Post
Old Jan 20th, 2008, 1:35 PM   #1
Chuckiferd
Programmer
 
Join Date: Nov 2007
Posts: 64
Rep Power: 1 Chuckiferd is on a distinguished road
My pyguessinggame

Could someone look this over


#import whrandom
def start():
answer=randint(1,101) #the answer
guessnum=0 #number of user guesses
guess=raw_imput ('guess my number, it is between 1 and 100') #user's guess
while guess!= answer:
   guessnum=guessnum+1
if(guess <= 0):
   print '''My number is between 1-100, you gave a negative just to see what I would say.'''
elif (guess >= 101):
   print'no the answer is below 101'
elif (guess > answer):
   print 'Too high'
elif (guess<answer):
   print 'guess higher, your guess is too low'
else:
   print 'Right on, congratualations that took', guessnum, 'tries.'
#I truly don't understand from here to.............
if _neame_ =='_main_':
   start():
   print
   raw_imput('press return')
else:
   print 'Module guessgame imported'
   print 'to run, type:guessgame.start()'
   print 'to refreash, type:reload (guessgame)'
#.....here
#end
__________________
There are 10 kinds of people in this world, those who can read binary and those who can't.
Chuckiferd is offline   Reply With Quote