Learn to Code via Tutorials on Repl.it!

← Back to all posts
an extremly quick basic python turtle tutorial
h
cannonthepom123 (14)

DISCLAIMER: THERE IS NO default TURTLE IN TURTLE ITS JUST AN ARROW THAT'S LOKS LIKE ITS FROM GOOGLE MAPS

Turtle is a python lib and is very easy to use.
i is like an HTML canvas but with python and in my opinion it's better.

importing turtle

First, you must create a python project and type the code below

import turtle

wow
Now install patience
plug a USB cord from the computer to your brain
then type

import patience

patience.activate()
# I hope you don't do this
#but you do need to be patient because no matter what speed its on it takes a while for It to draw curves 

then run the code
(please don't)

turtle basics

each turtle command starts with ' turtle. ' unless you imported the specific command(more on that later)

turtle commands

turtle.forward(distance) #moves turtle forward
turtle.right(angle)
turtle.left(angle)
turtle.goto(x, y)
turtle.setheading(direction) #set direction of the turtle
turtle.color("color")
turtle.color(r, b, g)
turtle.write("text", move=true/talse, align="left"/"right", font=(‘font’, size, ‘normal’)) 

that's all the basic commands you can find more by googling and stuff

#importing specific commands

if you're tired of typing "turtle"
you can import specific turtle commands.

from turtle import forward #it can be any turtle command but that's just an example

now instead of turtle.forward(10) is forward(10)
or any other command you imported.

Comments
hotnewtop
CoderBean (11)

turtle.shape("turtle") makes it turtle instead of arrow

cannonthepom123 (14)

@ChickenTendys
yes but the default drawing part is arrow let me update it