Allen Downey in his book Think Python poses the reader with a problem !
Write a function named check_fermat that takes four parameters — a, b, c and n — and that checks to see if Fermat’s theorem holds.
A suitable program may be made as;
Fig 2. Python Code for check_fermat