Python Python Basics Functions and Looping Create a Function

Luis Barahona
Luis Barahona
814 Points

I need help

How do I do this?

squaring.py
 def square(number):
    result = (number * number)
    return(result)
results = square(3)

2 Answers

Juthawong Naisanguansee
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 79,755 Points

Hi Luis , You are doing Great :)

Your code works but Treehouse Grader want you to store in variable name result

Since your square function returns a value, create a new variable named result to store the value from the function call.
 def square(number):
    result = (number * number)
    return(result)
result = square(3)

Thanks

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 47,441 Points

The new variable to store square(3) is result not results. Make that change and you should pass.