0

i am completely a newbie and learning python in vscode i dont understand why im getting this message help me to fix it

ho = input('what is your name')
print(ho)

error

Traceback (most recent call last):
  File "/Users/sar/Desktop/python/csp1.py", line 1, in <module>
    ho = input('what is your name')
  File "<string>", line 1, in <module>
NameError: name 'f' is not defined

expecting;

ho = input('what is your name')
print(ho)

output;

what is your name sar
sar
buran
  • 13,682
  • 10
  • 36
  • 61
  • 1
    Do you input `f` when asked to input your name? Most likely you run your code with python2, when you should be using python3. Check https://stackoverflow.com/q/4915361/4046632 – buran Nov 01 '22 at 07:15

1 Answers1

0

Try to check with the python version for python 3.8

#for string input

ho = str(input('Enter your name:')) print(ho)

#for number input

ho = str(input('Enter your name:')) print(ho)