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 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,160 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