Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Functions and Looping Create a Function

https://secure.gravatar.com/avatar/f2397475d29e4d20dbe7de375c0d09ba?s=60&d=https%3A%2F%2Fstatic.teamtreehouse.com%2Fasse

def square (number): return (number *number) print (square(2)) result=square("number") print(result)

squaring.py
def square (number):
    return (number *number)
print (square(2))
result=square("number")
print(result)
Jason Anders
Jason Anders
Treehouse Moderator 145,623 Points

Moderator Note: Duplicate posts containing identical content have been deleted from the Community. Please refrain from multiple postings with the same content.

It's also a good idea to include a Meaningful title to the post and include a question. Just posting code with no question, reference, or problem stated makes helping troubleshoot quite difficult.

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,623 Points

As I pointed out above, you didn't state what problems you are having, so this is complete a guess on the issues.
Looking at your code, you have what is needed to pass the first task, but you have way more code than what is asked for in the second task. The second task does not ask for a print statement, so both of them should be deleted. You have the variable asked for (result), but the instruction say to assign the resulting function call with an argument of 3 passed in. You are calling the function but passing in the string "number".

Just fix those few things up and you should be good to go.

If this doesn't solve your problem, you'll need to post the question again with your code, but include the issues you feel you are struggling on, so the Community can best assist you.

:) :dizzy: