英文:
The term "" is not recognized as the name of a cmdlet, function, script file, or executable program
问题
我第一次在VSCode上工作,我按照所有的安装步骤进行了操作,但每次我尝试在控制台中执行函数时,控制台中的答案总是:(并非强制"notes",这里是函数调用的参数)
notes: 术语"notes"未被识别为cmdlet、函数、脚本文件或可执行程序的名称。请检查名称的拼写,或者如果存在路径,请验证路径是否正确,然后重试。在第1行的字符:13
+ modalite_c2(notes)
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (notes:String) [], Com
mandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我找不到在线答案,所以有人可以帮助我解决这个问题吗?提前感谢!如果你需要,以下是函数:
notes = [9, 12, 18, 11]
def modalite_c1(notes):
resultat = 0
resultat = (sum(notes) - min(notes)) / 3
return resultat
英文:
I'm working on VSCode for the first time, I followed all the installation steps, but every time I launch a program with functions, when I try to execute the function in the console, the answer in the console is always : (not forcibly "notes", here it's the argument of the function called)
notes: The term "notes" is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path exists, verify that the path is correct and try again. At Line:1 character: 13
+ modalite_c2(notes)
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (notes:String) [], Com
mandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I can't find an answer online so can someone help me to solve this please. Thanks in advance !
Here is the function if you want :
notes = [9, 12, 18, 11]
def modalite_c1(notes):
resultat = 0
resultat = (sum(notes) - min(notes)) / 3
return resultat
答案1
得分: 0
在终端中直接键入Python代码是错误的。您可以在代码中使用print()
函数,然后执行代码,或者使用Python交互终端执行部分代码,然后使用输出语句输出结果。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论