In this assignment, we created 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”.
Objective: Is to understand how fruitful functions work and how they are applied. You must always have a return value when solving something like this:
Overall Experience: As you may notice, coding isn’t as easy as it looks. When creating this program, I had a hard time trying to input numbers. According to our directions in creating this, we had to input value numbers that would make this equation correct and would process through and then again incorrect to see the difference. The main issue seemed that I wasn’t putting the phrase “int”, in other words referringĀ to “integers”, and the word input for each letter. Allowing the user to input any number value for each letter as shown above.