小编Jam*_*Lee的帖子

Do Python comments have to be indented the same as surrounding code blocks? (VS Code)

I'm working on a Python project using VS Code as my editor, and I'm getting a Python indentation error when I place comments in between blocks of code. Specifically:

while score0 < goal and score1 < goal:
    if player:
        ...
    else:
        ...
    player = other(player)

# END PROBLEM 5
# BEGIN PROBLEM 6
"*** YOUR CODE HERE ***"
    say(score0, score1)
Run Code Online (Sandbox Code Playgroud)

I'm getting an indentation error when I evoke say(score0, score1), but the error gets fixed if I indent the comments …

python indentation visual-studio-code

2
推荐指数
1
解决办法
74
查看次数

标签 统计

indentation ×1

python ×1

visual-studio-code ×1