Fermat’s Last Theorem states that no three positive integers a, b, and c can satisfy the equation an + bn = cn for any integer value of n greater than two.
For this asignment, a code had to created which would allow a user to input numbers for a,b,c, and n to see if Fermat’s last Theorem is correct or false.
On the window to the left of the image:
The code on lines 1-4 makes it so that a user can put values for a,b,c, and n only using numbers.
On lines lines 5 a function called “check_fermat” was created that took the arguments a,b,c, and n.
Line 6-7 means that if the numbers the user selected satisfies the equation, they’ll get the message “Fermat was right!
Lines 8-9 means that if the user inputs numbers that doesn’t satisfy the equation, they’ll get the message “No, that doesnt work”
The final line calls the function “check_fermat” so that the code could run and do what its suppose to do.
The window to the right displays a user inputting numbers to see if it would satisfy the equation.