Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import random
  2.  
  3. b = random.randnint(0, 5)
  4. count = 0
  5. print('Random number from 0 to 5')
  6. print('You have only 3 attemps!')
  7. while True:
  8. i = float(input('Your guess: '))
  9. if i!=b:
  10. count += 1
  11. print('Nooope')
  12. if count == 3:
  13. print("Sorry, you didn't guess. The number was:",b)
  14. ans1 = input('Do yo want repeat? (y/n):')
  15. if i==b:
  16. print('You win!')
  17. ans2 = input('Do yo want repeat? (y/n):')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement