54.3k views
4 votes
(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.

User Keena
by
5.6k points

1 Answer

8 votes

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

Step-by-step 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]}\\Mod: {valueArr[1]}\\Quadrupled: {valueArr[2]}")

User Dre Ross
by
5.1k points