我在课堂上有一个类和函数。它们都工作正常但是当我输入循环以便它可以继续要求用户放入另一个循环时它会崩溃。发生了什么事?没有循环,一切都很好......
from turtle import*
snowman = 1
owl = Owlet()
s_answer = input("radius of first snowman circle?")
answer = int(s_answer)
s_xPos = input("What is your x position?")
xPos = int(s_xPos)
s_yPos = input("What is your y position?")
yPos = int(s_yPos)
#owl.__init__(xPos,yPos,answer,"black")
owl.centered_circle(xPos,yPos,answer,"black")
while snowman == True:
answer = int(s_answer)
s_xPos = input("What is your x position?")
xPos = int(s_xPos)
s_yPos = input("What is your y position?")
yPos = int(s_yPos)
#owl.__init__(xPos,yPos,answer,"black")
owl.centered_circle(xPos,yPos,answer,"black")
答案 0 :(得分:0)
除非在循环中的某处插入break
或snowman=False