import turtle
ved_turtle = turtle.Turtle()
def square():
ved_turtle.forward(100)
ved_turtle.right(90)
ved_turtle.forward(100)
ved_turtle.right(90)
ved_turtle.forward(100)
ved_turtle.right(90)
ved_turtle.forward(100)
ved_turtle.right(90)
elephant_weight = 3000
ant_weight = 0.1
if elephant_weight < ant_weight:
square()
else:
ved_turtle.forward(0)
为什么在Visual Studio 2019社区版中打开后,我的乌龟窗口会立即关闭,而在repl.it中却没有立即关闭?
答案 0 :(得分:1)
在脚本末尾添加input()
,使其等待Enter键。