STAY INFORMED
following content serves as a personal note and may lack complete accuracy or certainty.

Minimal-Mistakes instruction
Useful vscode Shortcut Keys
Unix Commands
npm Commands
Vim Commands
Git Note
Useful Figma Shortcut Keys

less than 1 minute read

Introduction

turtle is pre-installed Python library that enables users to create pictures with a virtual canvas. For the programmer who needs to produce some graphical output it can be a way to do that.

Code

import

from turtle import *

Basic drawing

These are the basic drawing syntax

up()  # sets the pen state to be up
down()  # sets the pen state to be down
left(degrees)  # facing left by the amount indicated by degrees
right(degrees)  # facing right by the amount indicated by degrees
forward(distance)  #  Moves the turtle forward
circle(radius):  # Draws a circle of the indicated radius.
color(color)  # Change the color of the pen
.
.
.

Using for loop

You can also use it with loop

e.g.

for n in range(20):
    if n % 2 == 0:
        color('red')

    else:
        color('blue')
    right(n * 18 - (n - 1) * 18)
    circle(50)

More info