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 Types and Branching If, Else and Elif

Kristian Vrgoc
Kristian Vrgoc
3,046 Points

file "<stdin>", line 1

Hello,

I tipped in everything as the coach and got this answer:

File "<stdin>", line 1 python hello.py

Whats wrong?

Thanks in Advance

Kris

2 Answers

Bas Dekker
Bas Dekker
1,001 Points

Hi Eric, I had this problem as well, then I realized I was still in the python interpreter. I typed:

exit()

then at the workspace prompt:

python hello.py

and it worked properly.

Bas

Thank you very much. I really appreciate it!

I have the same problem. This is my code:

first_name = input("What is your first name? ") print("Hello,",first_name) if first_name == "Eric": print(first_name, "is learning Python") print("Have a great day {}!".format(first_name))

Eric Yim i have check your code there is no error shows me

          first_name = input("What is your first name? ") 
print("Hello,",first_name) 
if first_name == "Eric":
    print(first_name, "is learning Python")
    print("Have a great day {}!".format(first_name))