-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice problem 2.py
More file actions
29 lines (24 loc) · 935 Bytes
/
practice problem 2.py
File metadata and controls
29 lines (24 loc) · 935 Bytes
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
28
29
while True:
try:
apple = int(input("Enter the total value:\n"))
mn = int(input("Enter the minimum value:\n"))
mx = int(input("Enter the maximum value:\n"))
if mn>mx:
print("Your minimum value is greater than maximum value")
except ValueError:
print("Your given input must be integer")
else:
for i in range(mn, mx+1):
if mn == mx:
print("There is no range between mn and mx")
for j in range(mn, mx+1):
if apple%j==0:
print(f"{j} is a factorial of {apple}")
else:
print(f"{j} is not a factorial of {apple}")
else:
if apple%i==0:
print(f"{i} is a factorial of {apple}")
else:
print(f"{i} is not a factorial of {apple}")
break