D: Fun with Turtle Art

Task1


Create a folder called pythonart
Right click the image below and save it into the folder

  • Copy and paste the following code into IDLE and save it in the pythonart folder
  • Change the code so it fits better with the background image
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import turtle
import random
trtl = turtle.Turtle()
screen=turtle.Screen()
screen.setup(520,420)
screen.bgpic('bg.gif')
trtl.pensize(4)
trtl.speed(1)
trtl.shape('turtle')
turtle.colormode(255)
trtl.pencolor(242,242,242)
trtl.penup()
trtl.setpos(-160,-100)
trtl.pendown()
for i in range(4):
    trtl.forward(40)
    trtl.left(90)
    trtl.forward(30)
    trtl.right(90)
    trtl.forward(40)

Task 2

  • Copy and paste the following code into IDLE and save it
  • Place it in the same folder as your saved python file
  • Change the code so it fits better with the background image
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import turtle
import random
import time
screen=turtle.Screen()
trtl=turtle.Turtle()
screen.setup(420,320)
screen.bgpic('bg.gif')
trtl.shape('turtle')
trtl.color('darkgoldenrod','black')
s=10
trtl.penup()
trtl.setpos(30,30)
for i in range(28):
    s=s+2
    trtl.stamp()
    trtl.forward(s)
    trtl.right(25)
    time.sleep(0.25)

Other images you can use


EXTENSION
Find other GIF iles to use
Use the link below to add effects

Turtle Tutorials