0

I am making a program just to test if I can get input from a user and display their input. I looked online on how to do it and I copied it and put it on my program but it gives me an error that says this,

Traceback (most recent call last):
  File "C:/Users/Home/PycharmProjects/untitled/j.py", line 1, in <module>
    a = input("enter your name")
  File "<string>", line 1, in <module>
NameError: name 'hi' is not defined

Here is my code,

a = input("enter your name")

print(a)

May you please help me on this? Thank you.

This is not a duplicate I didn't even know there were other people that asked this question.

zane
  • 11
  • 1
  • 2
  • 7

1 Answers1

0

Solution:

a = raw_input('Enter your name')

print a

However the raw_input does not exist in Python 3.x. What's the difference between raw_input() and input() in python3.x?

Community
  • 1
  • 1