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

Nathaniel Agbontaen
Nathaniel Agbontaen
277 Points

I tried to put my name and, that I am learning python, but it still showed "Hello, World." Please help me.

I tried to write "Hello, Nate" and "Nate is learning python", but it showed "Hello World" Please help me.

Can you add a snapshot? That way a mistake can be identified

Michael Zhang
Michael Zhang
10,168 Points

Did you save after you finished?

3 Answers

Hi Nathaniel Agbontaen, What you have is correct. I have tried running your code and the outcome is same as what you expected.

print("Hello, Nate") 
print("Nate is learning python")

So, my guess is make sure you save the file before executing it!

I will assume you were printing the strings this way!

  print("Hello, World")
  print("Hello, Nate")
  print("Nate is learning python")
Nathaniel Agbontaen
Nathaniel Agbontaen
277 Points

So what I did instead was this:

print("Hello, Nate") print("Nate is learning python")

Then for the console I did this:

treehouse : ~/workspace$ python hello.py Hello, World treehouse : ~/workspace$

Expected result was supposed to be this:

treehouse : ~/workspace$ python hello.py Hello, Nate Nate is learning python treehouse : ~/workspace$

What am I doing wrong?

Thanks, Nate

Nathaniel Agbontaen
Nathaniel Agbontaen
277 Points

Okay, I saved it before executing it, and it worked! Thank you so much Shem!