name = input() File "", line 1, in NameError: name 'k' is not defined..._nameerror: name 'k' is not defined">
当前位置:   article > 正文

python: NameError: name ‘ xxx‘ is not defined_nameerror: name 'k' is not defined

nameerror: name 'k' is not defined

name.py

  1. name = input()
  2. print('hello,', name)

# python name.py 
k
Traceback (most recent call last):
  File "name.py", line 1, in <module>
    name = input() 
  File "<string>", line 1, in <module>
NameError: name 'k' is not defined

# python3 name.py 
k
hello, k

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/670023
推荐阅读
相关标签