Python Python Basics Functions and Looping Create a Function

Create a function named square. It should define a single parameter named number. In the body of the function, return

Create a function named square. It should define a single parameter named number.

In the body of the function, return

squaring.py
def square(number): 
number = input
    Value = number * number
    return value

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 58,893 Points

You are on the right track. There is no need to use input with functions. They get their input from the arguments passed into their parameters in the signature. You'll see these terms used a lot.

The variable value should be lowercased to match the parameter name value.

Post back if you need more help. Good Luck!!

[redacted]
 value = number * number

[MOD: redacted]

Chris Freeman
Chris Freeman
Treehouse Moderator 58,893 Points

Hi 925 prod, we discourage posting of cut and paste answers in the forum. I have redacted part of your answer.