在 Visual Studio Code 中运行 Python 代码非常简单:

  1. 安装 Python 扩展:在 Visual Studio Code 中打开扩展面板(Ctrl + Shift + X),搜索 "Python",并安装该扩展。
  2. 创建 Python 文件:在 Visual Studio Code 中新建一个文件,并将其命名为 .py。
  3. 编写代码:在 .py 文件中编写你的 Python 代码。
  4. 运行代码:按下 F5 或者在终端中使用 "python filename.py" 运行代码。