(in PYTHON) Write a function in REPL.it that uses three parameters, and squares the first, calculates mod 5 of the second parameter, and quadruples the third parameter. The function should be called, and that value stored in a variable, and then outputted using the print( ) function.

Respuesta :

Answer:

I wrote this myself, it should be working. I think this is what the instructions were looking for.

The code below should return

Squared: 1296  

Mod: 0        

Quadrupled: 16

Explanation:

def threeParams(squared, mod, quadruples):

   array = [squared, mod, quadruples]

   array[0] = squared ** 2

   array[1] = mod % 5

   array[2] = quadruples * 4

   return array

valueArr = threeParams(36, 15, 4)

print(f"Squared: {valueArr[0]}\nMod: {valueArr[1]}\nQuadrupled: {valueArr[2]}")