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

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.