简体   繁体   English

Python 代码在 Visual Studio 中运行时抛出错误

[英]Python code throws error while running in Visual Studio

I am absolutely new to Python. I tried running this code我对 Python 完全陌生。我试过运行这段代码

someone = 'Lovegood'
print (someone)

And I am getting this error我收到了这个错误

Traceback (most recent call last): File "", line 1, in NameError: name 'someone' is not defined **追溯(最近一次通话):文件“”,第 1 行,在 NameError 中:未定义名称“某人” **

Can someone please help me?有人可以帮帮我吗?

Check whether you have selected a python interpreter in the visual studio or not.查看是否在visual studio中选择了python解释器。 Also, make sure to save the file with a.py extension.另外,请确保使用 .py 扩展名保存文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM