I was actually able to fix the code and run it, now i need to run tests  but 
idk what tests to write or how to even write it.

[code]
import random

intro = 'I have chosen a number from 1-10'
request = 'Guess a number: '
responseHigh = "That's too high."
responseLow  = "That's too low."
responseCorrect = "That's right!"
goodbye = 'Goodbye and thanks for playing!'

print(intro)

def main():
    guessesTaken = 0
    number = random.randint(1, 10)
    while guessesTaken < 5:
        print(request)
        guess = input()
        guess = int(guess)

        guessesTaken = guessesTaken + 1

        if guess < number:
            print(responseLow) 

        if guess > number:
            print(responseHigh)

        if guess == number:
            break

    if guess == number:
            guessesTaken = str(guessesTaken)
            print(responseCorrect + '! You guessed my number in ' + 
guessesTaken + ' guesses!')

    if guess != number:
        number = str(number)
        print(goodbye + ' The number I was thinking of was ' + number)

##def main():
#    print(intro)
 #   user_input = raw_input(request)
  #  print(responseHigh)
  #  print(request)
  #  user_input = raw_input(request)
  #  print(responseLow)
  #  user_input = raw_input(request)
  #  print(responseCorrect)
  #  print(goodbye)

if __name__ == '__main__':
    main()
[/code]

On Friday, September 27, 2013 12:46:01 AM UTC-4, Steven D'Aprano wrote:
> On Thu, 26 Sep 2013 21:20:52 -0700, melwin9 wrote:
> 
> 
> 
> > I modified  the guess.py file but am unable to run it, 
> 
> 
> 
> What does that mean?
> 
> 
> 
> How do you try to run it?
> 
> 
> 
> What happens when you do?
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> Steven

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to