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 trialHarwood Jones
1,377 PointsDefining the function
I'm not sure if I'm way off or not. Am I defining correctly?
import math
def square(number)
return number * number
number = int(input())
2 Answers
Miss Lucy Andresen
3,070 Pointsdef square(TheNumber):
return number * number
number = int(input("please insert a number" ))
the_ancear = square(number)
print("the square root of {} is".format(number),the_ancear)
your missing some dots and the name of the def was the same as the input they need to be different names I also put in some user text and a print statement with a bit of formatting to see what you are doing
Taurai Mashozhera
2,308 PointsYou forgot to put the colons after defining the function . def square(number): return number*number There is no need of importing math and using the input method because it is not asked for.
Happy coding
lemelleio
10,874 Pointslemelleio
10,874 PointsEDIT woops sorry, didn't see the second step.
There's no need to import math in this challenge. Also the challenge asks you to assign the output of your function to "result"
you only need the following: