Fruitful Functions

fruitful functions(1)fruitful functions(2)fruitful functions (3)

Lab Description:

For today’s lab, we learned about Fruitful Functions where we prove Fermat wrong based on his theory about the function: n>2 and a**n + b**n == c**n. The result should either come out as “Fermat is correct” or “No,it doesn’t work”. Below the codes, I put different values for a, b, c and n. After that, I want Python to print out the result if Fermat was correct or it doesn’t work. So I write check_fermat (a,b,c,n) and the result came out as “No,it doesn’t work”. Now that the program tells us that Fermat’s theory didn’t work, I wanted the user to input his own values and get the same result. So I keep all the previous codes and add raw_input for each value. For example, a= int( raw_input(“Enter a value for a”)), b = int(raw_input(“Enter a value for b”)) and so on. Once I write raw_input for a,b,c and n and I run the module, it should allow the user to input his own value for each letter and the result should come out as ,”No it doesn’t work.” I tried to use these codes in the latest version of Python which was 3.5 and raw_input didn’t work because you can simply put input without raw since the program was updated. I didn’t need to write an extra word for input. Simply int(input(“Enter a value for __”)) was fine.