Python 如何在没有函数的情况下使用turtle.reset()函数

Python 如何在没有函数的情况下使用turtle.reset()函数,python,turtle-graphics,python-turtle,Python,Turtle Graphics,Python Turtle,我不知道如何在短期内显示代码,但我可以尝试一下。我想知道在函数中创建turtle时如何使turtle.reset()工作: def scissors(x,y): scissors = turtle.Turtle() scissors.speed(0) scissors.color("maroon") scissors.fillcolor("red") 接着是石头、布和剪刀的代码 然后: 以此类推,但最后我想重置,我做了: rock.reset() paper.rese

我不知道如何在短期内显示代码,但我可以尝试一下。我想知道在函数中创建turtle时如何使turtle.reset()工作:

def scissors(x,y):
  scissors = turtle.Turtle()

  scissors.speed(0)
  scissors.color("maroon")
  scissors.fillcolor("red")
接着是石头、布和剪刀的代码 然后:

以此类推,但最后我想重置,我做了:

  rock.reset()
  paper.reset()
  scissors.reset()
在检查了if-else语句中的所有内容后,当它到达reset函数时返回:

AttributeError: 'function' object has no attribute 'reset' on line 318
请帮助我(如果需要链接到下面的项目)


我猜这是因为您有一个名为
scissors()
的函数和一个名为
scissors
的变量。更改其中一个的名称。@cdlane是正确的-您需要更改海龟名称或函数名称。我猜这是因为您有一个名为
scissors()
的函数和一个名为
scissors
的变量。更改其中一个的名称。@cdlane是正确的-您需要更改海龟名称或函数名称。
AttributeError: 'function' object has no attribute 'reset' on line 318