该术语不被识别为 cmdlet、函数、脚本文件或可执行程序的名称。

huangapple go评论70阅读模式
英文:

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

Picture

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交互终端执行部分代码,然后使用输出语句输出结果。

该术语不被识别为 cmdlet、函数、脚本文件或可执行程序的名称。

该术语不被识别为 cmdlet、函数、脚本文件或可执行程序的名称。

英文:

It is wrong to type the Python code directly in the terminal. You can use the print() function in the code and then execute the code, or use the Python interactive terminal to execute part of the code, and then use the output statement output result.

该术语不被识别为 cmdlet、函数、脚本文件或可执行程序的名称。

该术语不被识别为 cmdlet、函数、脚本文件或可执行程序的名称。

huangapple
  • 本文由 发表于 2023年3月7日 11:55:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75657913.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定