from fractions import Fraction as Fr
def reciprocal(LIST,E,F):
    #Ax + By = E
    #Cx + Dy = F
    A = Fr(LIST[0][0])
    B = Fr(LIST[0][1])
    C = Fr(LIST[1][0])
    D = Fr(LIST[1][1])
    n = ((A*D)-(B*C))
    if n == 0:
        return None
    return [(D*E-B*F)/((A*D)-(B*C)),(A*F-C*E)/((A*D)-(B*C)),]

print(reciprocal([[1,2],[2,3]],1,1))

print(reciprocal([[1,1],[10,30]],15,100))

#print(reciprocal([[int(input()),int(input())],[int(input()),int(input())]],int(input()),int(input())))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: