Python Python Basics Functions and Looping Create a Function

Joshua Salmon
Joshua Salmon
1,235 Points

Creating a function activity.

I do not understand why this does not work for the activity? The code runs perfectly in VSCode.
number = float(input("Pick any number: "))

def square(number):
    square = float(number * number)
    return square

result_square = square(number)

1 Answer

Clayton Perszyk
Clayton Perszyk
Treehouse Moderator 46,458 Points

You shouldn't use input, but pass the number,3, directly to square(). You also need to change the variable name to result.