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 (2015) Python for Beginners Call a function

myfirstfunction(): print("hello,treehouse") is it wrong

i cant understand what is wrong in that

function.py
myfirstfunction():
    print("hello,treehouse")

1 Answer

Steven Parker
Steven Parker
216,000 Points

The code is missing the "def" keyword to define the function, but that would still be not what the challenge asked for. The instructions say "Use the print() function to print the string "Hello, Treehouse"." There's nothing about putting it inside another function.

Also, the challenges are very picky about outputs. So the message needs to be exactly as given in the instructions, including spelling , punctuation, spacing and capitalization.