Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import random
  2.  
  3. def main():
  4.     print "I am thinking of a number from 1 to 10\nYou must guess what it is in three tries"
  5.     Guess = 0
  6.     Tries = 2
  7.     Answer = random.randint(1,10)
  8.  
  9.     while ( Guess != Answer):
  10.         Guess = input(str(Answer)+"\nEnter your guess: ")
  11.         if ( Guess == Answer ):
  12.             print "CORRECT!"
  13.         elif ( Guess is not Answer and Tries is 0 ):
  14.             print "You're a faggot.\nExiting"
  15.             break
  16.         else:
  17.             print "Sorry, please guess again"
  18.             Tries -= 1
  19. if True:
  20.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement