Christopher Hill1,030 Points
How do I call my new function and call past in the argument 3?
def square(number): return number * number result = number * number * 3
Ave Nurme15,612 Points
I believe you are stuck on Challenge Task 2 of 2. Let's walk you through this step by step.
Here's the text from the challenge:
Great now that you have created your new
square method, let's put it to use.
Under the function definition, call your new function and pass it the argument
square function returns a value, create a new variable named
result to store the value from the function call.
So, you created your new square method, great!:
def square(number): return number * number
For step no 2 we have to call our new function, here's how to do it in general:
So, calling a function means you just add a set of parens after the name of your function.
Next, we have to pass the function the argument
3, here's how to do it:
And finally, we have to create a new variable called
result and store the value from the function call:
result = square(3)
Here, we assign the value
square(3) to a variable called
So if we put the pieces together, here's the final code which should pass the challenge:
def square(number): return number * number result = square(3)
So, the number
3 actually goes instead of
return number * number
3 * 3.
I hope this makes sense!