Python Python Basics Functions and Looping Create a Function

can anybody help me with this one im soo stumped

dont get it

squaring.py
def square(number):
    number = number * number

number = 5

2 Answers

You're pretty close on this. Remember that your function needs to return something at the end. The squared value of a number is number * number, as you've already written, but at the moment your function doesn't return that value at any point. You can make a small change to that line to get it to work.

Also on line four, you don't need to assign anything to number. The question doesn't ask you to call the function, but the syntax for that would just be square(5)

Trevor Codner
Trevor Codner
1,700 Points

Hello, It got me too for a while, I found walking a way for a few hours and then coming back to it helped a great deal. Also I was in to much of a rush to read the question properly. So was not doing what the question was actually asking for. Hope this helps