0
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)

Why does my turtle window close immediately after opening in the community edition of Visual Studio 2019, but it does not close immediately in repl.it ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ved Pawar
  • 148
  • 8

1 Answers1

1

Add input() at the end of the script to make it wait for the Enter key.

HotFondue
  • 28
  • 4