我尝试了几种不同的缩进“样式”,但是VSCode坚持认为第70行存在缩进错误。
为便于记录-标识符语句以及下面的所有内容在IDE中都进行了缩进。
for node in nodes:
identifier = node['id']
group = node['group']
# Checking if the node is immediately related to the viewer
if (group == viewer_group):
note = {'source': identifier,
答案 0 :(得分:2)
for之后需要缩进,直到循环结束
for node in nodes:
identifier = node['id']
group = node['group']
# Checking if the node is immediately related to the viewer
if (group == viewer_group):
note = {'source': identifier,
# code after loop
...