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

Why does a single quote need to be included to print something? Example: 'print(Hello, Treehouse")'.

Why does a single quote need to be included to print something? Example: 'print("Hello, Treehouse")'. Why doesn't this work.. print("Hello, Treehouse").

Additionally, why can't there be a space before the open parenthesis? Example: 'print ("Hello, Treehouse")'.

function.py

2 Answers

Not sure I understand. The challenge is quite happy with the following:

print( "Hello, Treehouse" )

That is, without surrounding single quotes and with spaces before and after the String.

But it is true the editor will accept this:

'print( "Hello, Treehouse" )'

which is a bit surprising!!

Thanks.