5

Although I know I can install ColabTurtle to use Turtle on a Colab Notebook, I cannot figure out how. Could someone please give me an example on how to run Turtle codes on Colab?

midicool
  • 53
  • 1
  • 3

1 Answers1

5

Here is an example notebook.

First, you need to install it.

!pip install ColabTurtle

Then import all functions and init it.

from ColabTurtle.Turtle import *
initializeTurtle()

Then call normal turtle commands, e.g.

forward(100)
right(90)
forward(100)
right(90)
forward(100)

You can see all supported commands in the code.

korakot
  • 37,818
  • 16
  • 123
  • 144