Python Python Basics Functions and Looping Create a Function

little lost.

squaring.py
def square(number):
    return number
amount = square(5*5)
print("square {}".format(amount))

1 Answer

Luka Sarich
Luka Sarich
13,204 Points

Hi Joshua,

A little suggestion for when you're seeking assistance in the community is to, clearly, state what you're having troubles within the title/body and not to make a new post about the same question numerous times in a spammy manner.

However, the challenge is asking for a square function which is a number multiplied by itself. Although I can see how you got the 5*5. The code you're looking for is :

def square(number):
    return number * number

So that way, when you call the function, it 'squares' whatever number passed in. Hope this helps. Don't get discouraged, the more you struggle the more you learn.

Happy Coding!!