fork download
  1. # your code goes here
  2. l = 6
  3. m = 8
  4.  
  5. def nwd(a, b):
  6. while a != b:
  7. if a > b:
  8. a = a - b
  9. elif a < b:
  10. b = b - a
  11. return a
  12.  
  13. dzielnik = nwd(l, m)
  14.  
  15. licznik = l // dzielnik
  16. mianownik = m // dzielnik
  17.  
  18. print(f"{licznik}/{mianownik}")
Success #stdin #stdout 0.07s 14120KB
stdin
Standard input is empty
stdout
3/4