Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The answer is to use Python:

import fractions

a = [insert list, deleting last item]

b = [insert list deleting first item]

for x, y in zip(b, a): print(fractions.Fraction(x, y))

Note: I added this answer before I saw that FrédéricC had provided an answer using SM, which is perfect. I have not deleted my answer, since I think it might help other beginners like me understand Python in addition to SM.

The answer is to use Python:

import fractions

a = [insert list, deleting last item]

b = [insert list deleting first item]

for x, y in zip(b, a): print(fractions.Fraction(x, y))

Note: I added this answer before I saw that FrédéricC had provided an answer using SM, Sage, which is perfect. I have not deleted my answer, since I think it might help other beginners like me understand Python in addition to SM.Sage.

The answer is to use Python:

import fractions

a = [insert list, deleting last item]

b = [insert list deleting first item]

for x, y in zip(b, a): print(fractions.Fraction(x, y))

Note: I added this answer before I saw that FrédéricC had provided an answer using Sage, which is perfect. I have not deleted my answer, since I think it might help other beginners like me understand Python in addition to Sage.

The answer is to use Python:

import fractions

a = [insert list, deleting last item]

item]

b = [insert list deleting first item]

item]

for x, y in zip(b, a): print(fractions.Fraction(x, y))

y))

Note: I added this answer before I saw that FrédéricC had provided an answer using Sage, which is perfect. I have not deleted my answer, since I think it might help other beginners like me understand Python in addition to Sage.

The answer is to use Python:

import fractions

import fractions

a = [insert list, deleting last item]

b =  [insert list deleting first item]

for x, y in zip(b, a):
    print(fractions.Fraction(x, y))

Note: I added this answer before I saw that FrédéricC had provided an answer using Sage, which is perfect. I have not deleted my answer, since I think it might help other beginners like me understand Python in addition to Sage.

The answer Another solution is to use Python:

import fractions

a = [insert list, deleting last item]

b =  [insert list deleting first item]

for x, y in zip(b, a):
    print(fractions.Fraction(x, y))