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
Tags