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

Python Python Basics Functions and Looping Create a Function

Felix Belga
Felix Belga
4,828 Points

what am I doing wrong

it a python squaring function

squaring.py
import math

def square(number):
    number = value*value
    return number
value = input()


print("The answer is number")

1 Answer

Mark Ryan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mark Ryan
Python Web Development Techdegree Graduate 28,648 Points

Hi Felix,

You've got the right idea. If this is for the challenge, you only require the function that you have already written (take out importing math, take out value=input(), and take out your print statement). All of that could have been used in another scenario but not for the challenge. Your answer should be three lines. Also, you want to pass value into your function not number. Number is what you're returning. I hope this helps you!