• API
• FAQ
• Tools
• Archive
daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. from random import randint
2.
3. number = None
4. guess = None
5. winner = False
6. wanna_play = None
7.
8. while winner != True:
9.     number = randint(1,10)
10.     guess = int(input("I have picked a number between 1 and 10. Which one is it? "))
11.     if guess == number:
12.         winner = True
13.         print("You win!")
14.         wanna_play = input("Play again? (y/n) ")
15.         if wanna_play == "y":
16.             winner = False
17.         else:
18.             print("Thanks, bye!")
19.             break
20.
21.     elif guess > number:
22.         guess = int(input("Too high! So? "))
23.     else:
24.         guess = int(input("Too low! So? "))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top