Python input error

后端 未结 4 692
[愿得一人]
[愿得一人] 2021-01-14 12:10

I\'m running python 2.7.10 on Mac OSX 10.9.5m and it\'s not working. Here\'s the code:

# YourName.py
name = input(\"What is your name?\\n\")
print(\"Hi, \",          


        
4条回答
  •  囚心锁ツ
    2021-01-14 12:23

    Python 3.X Syntax for getting User Input

    name = input("What is your name?\n")

    Python 2.X Syntax for getting User Input

    name = raw_input("What is your name?\n")

提交回复
热议问题