Ask coding questions

← Back to all posts
There is an error on Line 15 of the code. Please help me while I try to fix it. Thanks!!
Kritini2030 (0)


This worked on a different website, but it's not working here, on replit. I am getting an NameError

Answered by Chocolate16 (36) [earned 5 cycles]
View Answer
Chocolate16 (36)

input function in Python 2.7, evaluates whatever your enter, as a Python expression. If you simply want to read strings, then use raw_input function in Python 2.7, which will not evaluate the read strings.

Coder100 (16850)

seems like an older version where there is a bug with the input function.
Report to bugs:

and try a different python version.

Chocolate16 (36)

there is a space between input and ('What is your name?'). i'm not sure if this correct

Coder100 (16850)

that is correct formatting @Chocolate16


you are using an old version of python. Use python 3. In python 2.7, you have to use raw_input. Not input. But as good practice, use python 3.

FishballNooodle (172)

It works perfectly fine for me.

You should be using python 3 not 2
Try removing the spaces between the function naem and the brackets tho.

Kritini2030 (0)

I know, @FishballNooodle but I can't find Python 3 on replit. The newest python version I was able to find, was python 2.7.

Kritini2030 (0)

I know, @FishballNooodle but on replit i cannot find python 3.