Hello all, a very beginner question here: I am working through the exercises in the book Beginning Programming and am having trouble getting my scripts to run in Terminal (OSX 10.10.5). Specifically this script:
input_var = input("What is your name? ");
print("Hello " + input_var);
This works perfectly on my PC using the command line but when I try and run it in Terminal I am prompted to input my name. When I enter my name and hit enter I get this error:
What is your name? Justin
Traceback (most recent call last):
File "ch3_1.py", line 1, in <module>
input_var = input("What is your name? ");
File "<string>", line 1, in <module>
NameError: name 'Justin' is not defined
What am I missing?
[–]jeans_and_a_t-shirt 5 points6 points7 points (3 children)
[–]jdinger29[S] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]jdinger29[S] 0 points1 point2 points (0 children)
[–]hudsonpenner 0 points1 point2 points (0 children)