abhijeeth s reduces large number to a more manageable number res5 7 4 892790030352132 res0 5 0 res3 0 1 res1 5 traceback most recent call last valueerror math domain error we use the relation xy ylog10x where 10 is the base read two numbers from input and typecast them to int using map function here x is the base and y is the power we find the log of each number using the function res which takes two arguments we check for the largest number abhijeeth s reduces large number to a more manageable number res 5 7 4 892790030352132 res 0 5 0 res 3 0 1 res 1 5 traceback most recent call last valueerror math domain error we use the relation x y y log10 x where 10 is the base 0 raised to any number is 0 any number raised to 0 is 1 main function read two numbers from input and typecast them to int using map function here x is the base and y is the power we find the log of each number using the function res which takes two arguments we check for the largest number
import math


def res(x, y):
    
    if 0 not in (x, y):
        
        return y * math.log10(x)
    else:
        if x == 0:  
            return 0
        elif y == 0:
            return 1  
    raise AssertionError("This should never happen")


if __name__ == "__main__":  
    
    
    prompt = "Enter the base and the power separated by a comma: "
    x1, y1 = map(int, input(prompt).split(","))
    x2, y2 = map(int, input(prompt).split(","))

    
    
    res1 = res(x1, y1)
    res2 = res(x2, y2)

    
    if res1 > res2:
        print("Largest number is", x1, "^", y1)
    elif res2 > res1:
        print("Largest number is", x2, "^", y2)
    else:
        print("Both are equal")