Marcus Lox
0
Q:

how to import turtle in python

import turtle
#making the turtle
t = turtle.Turtle()
#commands
t.forward(10)
t.colour('green')
t.left(90)
t.penup()
t.goto(0,0)
t.pendown()
for i in range(45): #circle
  t.forward(1)
  t.right(8)
for i in range(3): #Triangle
  t.forward(10)
  t.left(135)
1
import turtle # imports it
whateverYouWantToCallIt = turtle.Turtle() # adds it to the project
#code
whateverYouWantToCallIt.forward(10) # moves whateverYouWantToCallIt forward
whateverYouWantToCallIt.color("purple") # color
whateverYouWantToCallIt.left(90) # turns him 90 degrees
whateverYouWantToCallIt.right(90) # turns him 90 degrees the other direction
1
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
    forward(200)
    left(170)
    if abs(pos()) < 1:
        break
end_fill()
done()
4
import turtle
win = turtle.Turtle()
0
import turtle
win = turtle.Screen()
0

New to Communities?

Join the community