Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
317 B
2
Indexable
Never
def check_fermat(a, b, c, n):
    if n <= 2:
        print("The value of n must be greater than 2.")
        return
    if a ** n + b ** n == c ** n:
        print("Holy smokes, Fermat was wrong!")
    else:
        print("No, that doesn’t work.")

# Example usage:
a = 3
b = 4
c = 5
n = 3
check_fermat(a, b, c, n)
Leave a Comment