Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # this will be a game that generates a random number for u to guess
  2. import random, sys
  3. winningnumber=random.randint(1,20)
  4. print ("Hey whats your name brah?")
  5. name=input()
  6. print("So " + name + " would you like to play a game?")
  7. playans=input()
  8. if playans == "yea" or "yes":
  9. print("cool im thinking of a number between 1 and 20 think you guess it?")
  10. else:
  11. print("fine.....queer")
  12. sys.exit
  13.  
  14. for guessestaken in range(1,7):
  15. guess=input()
  16. guess = int(guess)
  17. if guess < winningnumber:
  18. print("Nah too low")
  19. elif guess > winningnumber:
  20. print("nope too high")
  21. elif guess == winningnumber:
  22. print("yea lucky guess")
  23. sys.exit()
  24. else:
  25. break
  26.  
  27. print("Sorry LOSER")
  28. #If I don't convert the guess to a integer my self Python errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement