Fermat’s Last Theorem

a=int(input(“Please give me a valu for a. “))
b=int(input(“Please give me a valu for b. “))
c=int(input(“Please give me a valu for c. “))
n=int(input(“Please give me a valu for n. “))

def check_fermat(a,b,c,n):
if a**n+b**n!=c**n and n>2:
print(“fermat was right!”)
else:
print(“Holy smokes, fermat was wrong!”)

check_fermat(a,b,c,n)

 

In this program we tried to see if the Fermat’s last theorem was right or wrong which was a**n+b**n=c**n. In order to do that I assigned variables a,b,c and n. Then i asked the user to input or give only integer as a value for the given variables. After that, I created a function by using def then I used if, and, and else condition to check the formula  a**n+b**n!=c**n and n>2 true or not. And i assigned the proper statements based on the condition’s outcome. After all of these, at the last I called the function.