【问题标题】:How to run for loop in visual studio with python codes如何使用 python 代码在 Visual Studio 中运行 for 循环
【发布时间】:2021-05-08 04:20:47
【问题描述】:

我是 Visual Studio 的新手,我运行 python 代码,但在每一行的末尾,我按 shift+enter 它适用于该行,但是当有 for 循环并且在行的 the 时,我按 shift+enter 它给出我收到一条错误消息,那么如何在 Visual Studio 中运行 for 循环。
下面是示例如何运行此代码?

cols = data.columns
for j in cols:
   for i in range(0,len(data)):
       if data[j][i] == -200:
           data[j][i] = data[j][i-1]

谢谢

【问题讨论】:

  • 给我们看一个例子。你的描述没有意义。自 Fortran 以来,我还没有听说过“do loop”这个词。

标签: python visual-studio


【解决方案1】:

shift + enter 运行一行代码。

要在您想按 ctrl+F5 或仅使用右上角的Play button 运行整个脚本

【讨论】:

    猜你喜欢
    • 2020-10-31
    • 2018-08-30
    • 2018-01-06
    • 1970-01-01
    • 1970-01-01
    • 2020-12-20
    • 2020-03-28
    • 2016-07-18
    • 1970-01-01
    相关资源
    最近更新 更多