Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program in python 3.x. Please add comments in order to increase understanding of

ID: 3872198 • Letter: P

Question

Program in python 3.x. Please add comments in order to increase understanding of the solution. (If possible try to make the code as simple as possible). Thanks

Fractions: You can express a fraction as a tuple: (numerator, denominator) (a) Write a function that adds two fractions that are passed as tuples (b) Write a function that multiplies two fractions that are passed as tuples. HINT: Use the following function gcd(x,y) to help you calculate the Greatest Common Divisor, which you will need to reduce fractions to the simplest form.] def gcd (x, y): To calculate the greatest common divisor of and y" x1 = abs (min(x, y)) y1 = abs (max (x, y)) gcdx1 if y1 % x1: gcd- gcd(x1, y1 % x1) return gcd

Explanation / Answer

This is the simplest code by importing modules.

Dr Jack
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote