-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimplifying fractions.txt
32 lines (32 loc) · 1.21 KB
/
Simplifying fractions.txt
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
30
31
32
#Simplifying fractions..
print("Please type the Numerator")
Numerator = input()
Numerator = int(Numerator)
print("Please type the Denominator")
Denominator = input()
Denominator = int(Denominator)
if Numerator%2==0 and Denominator%2==0:
while (Numerator%2==0) and (Denominator%2==0):
Numerator = Numerator/2
Denominator = Denominator/2
print(Numerator,"/",Denominator)
if Numerator%3==0 and Denominator%3==0:
while (Numerator%3==0) and (Denominator%3==0):
Numerator = Numerator/3
Denominator = Denominator/3
print(Numerator,"/",Denominator)
if Numerator%5==0 and Denominator%5==0:
while (Numerator%5==0) and (Denominator%5==0):
Numerator = Numerator/5
Denominator = Denominator/5
print(Numerator,"/",Denominator)
if Numerator%6==0 and Denominator%6==0:
while (Numerator%6==0) and (Denominator%6==0):
Numerator = Numerator/6
Denominator = Denominator/6
print(Numerator,"/",Denominator)
if Numerator%7==0 and Denominator%7==0:
while (Numerator%7==0) and (Denominator%7==0):
Numerator = Numerator/7
Denominator = Denominator/7
print(Numerator,"/",Denominator)