M
M
Mikhail Lebedev2020-03-16 11:11:37
Python
Mikhail Lebedev, 2020-03-16 11:11:37

Sublime Text3 and Python?

print('Enter your name:')
x = input()
print('Hello, ' + x)


Why is it showing this
Enter your name:
Jack
Traceback (most recent call last):
  File "PY copy.py", line 2, in <module>
    x = input()
  File "<string>", line 1, in <module>
NameError: name 'Jack' is not defined
>>>


when it should issue norms)))
Years issue normally

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas V, 2020-03-16
@zaza41rus

It looks like you are running this script in python2. In the 2nd python, raw_input is used to input strings

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question