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 (Retired) Ins & Outs String Concatenation

I keep getting an EOF error on Python

This is the code that I am using:

name = input("What is your name? ")

if name == "Rob":
  print(name + "is awesome!")
else:
  print(name + "isn't awesome!")

--> Please let me know if you find any flaw in this

I think he does not.

No I did not - I am planning on going through all of the videos again so I can see if I am just misunderstanding something and if I still have an issue I will let you know. Thank you.

4 Answers

I'm not an expert, but it seems like you are not indenting your code well

try

name = input("What is your name? ")

if name == "Rob":
  print(name + " is awesome!")
else:
  print(name + " isn't awesome!")

It may be because you use Python 2 version. In here, we use Python 3. Try the code below.

name = raw_input("What is your name? ")

if name == "Rob": 
     print(name + " is awesome!")

else: 
    print(name + " isn't awesome!")

I hope it helps

Just to give context I am using this for the code challenge on the "ins & outs" section of the Python Basics Course and when I copied and pasted your code it says: "Bummer! NameError: name 'raw_input' is not defined"

then try this

name = input("What is your name? ")

if name == "Rob": 
     print(name + " is awesome!")

else: 
    print(name + " isn't awesome!")

Thank you for the quick response. I tried it but still wouldn't work for me. I even tried copying and pasting what I did in Workspaces because it worked there but that didn't do me any good either.

Hi Robert,

This might be a problem with the Code Challenge Engine unfortunately. Hopefully not, but in case, I'm copying in a dev from the Education Team, Kyle Meyer

Sorry for the trouble!

Ryan

Odd, because it did work (and does work) in my workspace

Have you remembered to save your file? If all fails try making a new file or open a new workspace