Fruitful Functions

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.

fruitful functions