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

Is it normal for this code to not work with other editor?

name = input("What's your name ")

if name == "Vipul": print("You are cool") else: print("Yikes")

I am using pycharm, but this code is not working on it. I get the error message:

What's your name Vipul Traceback (most recent call last): File "/Users/vipulperiwal/Desktop/treehouse/lumberjack.py", line 1, in <module> name = input("What's your name ") File "<string>", line 1, in <module> NameError: name 'Vipul' is not defined

1 Answer

Johan Prieto
Johan Prieto
6,513 Points

I ran this code in IDLE 3.4.3 and it worked perfectly, it just does not work if you don't indent properly.

Thanks, I don't think that I was running the latest version of python.