Fermat’s Theorem Program

This program was interesting and taught me more about the use of the define function. Although it was difficult to complete at first I was able to successfully accomplish the task and it helped to prove if Fermat’s Theorem is correct or not. The program prints the correct things and outputs the correct things when the program is run. Overall, although I faced some difficulty doing the lab, it was very interesting to complete.

def check_fermat(a, b, c, n):
if n > 2 and (a**n + b**n == c**n):
print(“Fermat was right!”)
else:
print(“Holy smokes, Fermat was wrong!”)
def check_values():
a = int(input(“Choose a number for a: “))
b = int(input(“Choose a number for b: “))
c = int(input(“Choose a number for c: “))
n = int(input(“Choose a number for n: “))
return check_fermat(a, b, c, n)

check_values()