The first screenshot shows that I created a function named check_fermat with four parameters—a, b, c and n. I had to check to see if Fermat’s theorem works or not. If n is greater than 2 and it turns out to be true that an + bn = cn the program would’ve said, “Fermat was wrong!”. Since it did not, the program said, “No, that doesn’t work.”
In the second screenshot, I wrote a function in which I had to plug in values for a, b, c and n, converting them to integers, and used check_fermat to check whether they work with Fermat’s theorem or not.
- Our greatest weakness lies in giving up. The most certain n way to succeed is always to try just one more time. - Thomas Edison
Learning Blog Archives