repl.it
@ebest/

simplification

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
n = int(input("Numerator? "))
d = int(input("Denominator? "))
print(str(n / gcd(n, d)) + "/" + str(d / gcd(n, d)))
?