Untitled
unknown
plain_text
2 years ago
317 B
9
Indexable
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)
Editor is loading...
Leave a Comment