Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- b = random.randnint(0, 5)
- count = 0
- print('Random number from 0 to 5')
- print('You have only 3 attemps!')
- while True:
- i = float(input('Your guess: '))
- if i!=b:
- count += 1
- print('Nooope')
- if count == 3:
- print("Sorry, you didn't guess. The number was:",b)
- ans1 = input('Do yo want repeat? (y/n):')
- if i==b:
- print('You win!')
- ans2 = input('Do yo want repeat? (y/n):')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement