Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #сокращение дробей
- from math import *
- def s(a):
- b = a.split('/')
- c = int(b[0])
- d = int(b[1])
- e = gcd(c, d)
- d1 = c // e
- d2 = d // e
- d1 = str(d1)
- d2 = str(d2)
- print(d1 + '/' + d2)
- s('3/5')
Advertisement
Add Comment
Please, Sign In to add comment