top of page
Search

PYTHON CODING

  • Writer: waclaw_koscielniak
    waclaw_koscielniak
  • Sep 19
  • 1 min read

from fractions import Fraction

f1 = Fraction(3, 4)

f2 = Fraction(2, 3)

result = f1 * f2 + Fraction(1, 6)

print(result, float(result))


from fractions import Fraction

f1 = Fraction(3, 4)

f2 = Fraction(2, 3)

result = f1 * f2 + Fraction(1, 6)

print(result, float(result))


[Running] python3 -u "/Users/name/test/test483.py"

2/3 0.6666666666666666


[Done] exited with code=0 in 0.071 seconds


Try to run to verify.
Try to run to verify.
















 
 
 

1 Comment


Guest
Sep 19

Run it.

Like
bottom of page