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 (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
231,236 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.