-2

i wrote following code but during run its gives name error in 'raw_input' please help me to out of this

my code is:fname = raw_input('enter a file name: ') print (fname)

Error is= name error:name 'raw_input'is not define

2
  • You are using Python 3, where raw_input has now been changed to simply input Commented Apr 13, 2017 at 18:14
  • Looks like you use Python 3 where raw_input doesn't exist. Replace it with input or switch back to Python 2. Commented Apr 13, 2017 at 18:15

1 Answer 1

0

raw_input on python 3+ is now just input()

fname = input('Enter a file name: ')
print(fname)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.