fork download
  1. print("\t\tWelcome to the Game of Guess")
  2.  
  3. import random
  4.  
  5. guess = random.randint(1,10)
  6.  
  7. play = 0
  8. while play != guess:
  9. play = int(input("Please guess the number"))
  10.  
  11. if play > guess:
  12. print("Your guess is higher, guess lower")
  13. elif play < guess:
  14. print("Your guess is lower, guess higher")
  15. else:
  16. print("You guessed the correct number:", guess)
  17.  
  18. input("\n\nPress Enter to exit")
Success #stdin #stdout 0.03s 10016KB
stdin
1
2
3
4
5
6
7
8
9
stdout
		Welcome to the Game of Guess
Please guess the numberYour guess is lower, guess higher
Please guess the numberYour guess is lower, guess higher
Please guess the numberYour guess is lower, guess higher
Please guess the numberYour guess is lower, guess higher
Please guess the numberYour guess is lower, guess higher
Please guess the numberYou guessed the correct number: 6


Press Enter to exit