-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
27 lines (18 loc) · 814 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import random
def generateRandomNumber():
return random.randint(int(minimum), int(maximum))
if __name__ == "__main__":
print("Please enter the minimum and maximum number for the random generator.")
minimum = input("What should the minimum number be? ")
maximum = input("What should the maximum number be? ")
if minimum.strip().isdigit():
if maximum.strip().isdigit():
if minimum > maximum:
print("The maximum number must be higher than the minimum number.")
else:
print("The random number between " + minimum + " and " + maximum + " is",
int(generateRandomNumber()))
else:
print("Please enter a number as maximum.")
else:
print("Please enter a number as a minimum.")