Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Chester Stephen
413 PointsI cant seem to make my function work.
On the snapshot above (under the file functions.py):
Can anybody pinpoint what is wrong with it?
1 Answer
Daniel Medina
13,863 PointsHello Chester,
There are a couple of things I noticed with your function:
First, in your square function, you aren't returning your squared number.
Getting the user input is a great step, but you need to convert it from a from a string to an integer. If you don't convert it, Python will give you an error because it can't square strings.
input_number = input("What number do you want to square? ")
input_number = int(input_number)
The last thing I noticed was that you aren't passing in your input to your function in your formatted string.
I hope this helps.