for r in range (self.rows):
color = self.color if color == delf.color2
else self.color2
以下是该行所在的代码。请详细解释我的代码。
答案 0 :(得分:0)
假设代码应为:
for r in range(self.rows):
if color == self.color2:
color = self.color
else:
color = self.color2
并且此代码位于类https://docs.python.org/3/tutorial/classes.html中,其中Class定义包含全局变量' rows'。
然后for r in range(self.rows)
表示:迭代(在'之后的代码:')等于变量行引用的数字的次数,其中r将首先取值0并以值行结束 - 。
希望这有帮助!