Python Python Basics Functions and Looping Create a Function

Troy Wheelhouse
Troy Wheelhouse
278 Points

Why is this wrong?

I plugged this code into my own python client and it worked perfectly, what is incorrect about it?
number = int(input("What number would you like to square?  "))
def square(number):
    return number*number
result = square(number)

print("The square of {} is {}!".format(number, result))

1 Answer

Chris Freeman
Chris Freeman
Treehouse Moderator 59,680 Points

You have it correct for Task 1. The issue is the challenge checker does not know what to do with the input statement. This, the call to square and the print statement are not needed for Task 1.

Post back if you need more help. Good Luck!