i cant pass this stage
Jassim Al-Hatem12,190 Points
Hi mate, maybe next time try to add in the question to the challenge or some code. Anyways, I'm gonna try to help you with both parts of the challenge.
So it wants you to create a function named square, let's do that
Then it said that it should define a single parameter named number.
Alright, it's pretty simple so far, now it wants us to return the square of number. To be honest with you, I hate squaring a number this way, but the challenge won't accept any other way, anyhow, I'm gonna show you both ways.
So the challenge wants you to do it this way.
def square(number): return number*number
I prefer using the module math to the way I showed above. you don't have to use the module, but it's cleaner.
This is the way I prefer.
import math def square(number): return math.pow(number, 2)
Now to the 2nd challenge. Firstly, it wants you to call your new function and pass it the argument 3.
Ok, let's do that.
def square(number): return number*number square(3)
But since your square function returns a value, it wants you to create a new variable named result to store the value from the function call.
Alrighty, let's do that.
def square(number): return number*number result = square(3)
I hope you understood everything. If you need anymore clarifications don't hesitate to ask.