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 Meet Python Variables

when I type 2 lines of code i don't get any syntax errors but its only printing out the first line. Any advise as to why

print"(Hello Dustin") print"(Dustin is learning python today")

Only the first line ever prints

2 Answers

Balazs Peak
Balazs Peak
46,080 Points

You have made a typo. The first doublequote is before the first parenthesy in your code, which shouldn't be the case. The parentheses should enclose the string value, which is noted with the sorrounding doublequotes.

print ("Hello, world!")
print ("Hello, world!")

There is one weird thing with the result you've got as well, though. I think you shouldn't get "print only once" result, I think you should have gotten a syntax error. Anyway, I think the mistake is addressed. Happy coding!

Nathaniel Daudrich
Nathaniel Daudrich
7,142 Points

I am also getting only 1 line. 1 print("Hello, World") 2 print("print second line")

it outputs: Hello, World

I tried it in terminal and it works, so the workspace might be faulty

sarvienn thevendran
sarvienn thevendran
734 Points

mate the " should not be before the parentheses.. it as to be : print("whatever u wanna print") i believe this was a careless error because u seem to have gotten it on the second one

cheers!