Created
May 11, 2021 22:47
-
-
Save mbjames/54514b1807d63aa6b20da81050cfb35e to your computer and use it in GitHub Desktop.
Random Number Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def random_number(): | |
print("\n Type (r) to generate a random number. (0 - 1000)") | |
print(" Type (q) to exit.") | |
answer = input("\n > ") | |
if answer == "r": | |
x = random.randint(0, 1000) | |
print("\n Number Generated:", x) | |
random_number() | |
elif answer == "q": | |
exit() | |
else: | |
random_number() | |
random_number() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment