Advertisement
Osbenv

Untitled

Sep 19th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import random
  2.  
  3. def GuessingGame(a = 7, b = 18):
  4.   print "I'm thinking of a number between", a, "and", b
  5.  
  6.   d = 0
  7.   contador = 0
  8.   c = random.randrange(a,b)
  9.  
  10.   while c != d:
  11.     e = input ("Enter a number: ")
  12.     d = int(e)
  13.  
  14.     contador += 1
  15.  
  16.   print "Correct. It only took you", contador, "tries!"
  17.  
  18.  
  19. GuessingGame()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement