Fruitful Functions

 

 

In this assignment we were told to create a function called check_fermat .  that takes four parameters—a, b, c and n and that is then checked to see if Fermat’s theorem holds. Only if n is greater than 2 and it turns out to be true that an + bn = cn , then the program through python would print “Fermat was right!” and if not then “No, that doesn’t work”.

Check Fermat
capture-png-3-1

 

Fermat was wrong!

capture-png-2

Fermat was right!

capture-11

it was a hard assignment because of the values input was a bit confusing. Overall our main goal was to get “Fermat was right” in the return. going back and forth and doing it over helped me finishing this assignment.