Fruitful Functions Lab # 5
For this lab we must create a function that test Fermatās number theorem. His 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. The casesĀ nĀ =Ā 1 and nĀ =Ā 2 were known to have infinitely many solutions. To create this function we must ācheck_fermat(a, b, c, n)ā. After that we must create two situations if we meet the conditions Fermat wants us two and the equation does show equality then a message should pop up saying āFermat was wrong!ā if anything other than equality is occurs then the statement āNo, that does not work.ā Should pop up. After that we want the user to assign numbers for the variables a, b, c, n. To do this we use āinput and integer modules. An example of this is a = int(input(āmessage hereā)) and what ever message you put should tell the user what to input as a value you repeat this step three time for the variables a, b, and c. The message you input should be āenter a value for xā x being the variable you are currently assigning. Finally the n variable should say āenter a value for n greater than 2. Your command line should look like this. The only time Femat was wrong is when a, b, and c were the integer 1.



