Demo entry 4722500

Turtle Graphic

   

Submitted by anonymous on May 11, 2016 at 08:26
Language: Python 3. Code size: 521 Bytes.

import turtle

def colored_square(t,s):		# Make multicolored square
  for x in ["peachpuff", "red", "hotpink", "blue"]:
    t.color(x)
    t.forward(s)
    t.left(90)

wn = turtle.Screen()
wn.bgcolor("lightblue")

leanna = turtle.Turtle()                 # Set attribute for Turtle
leanna.pensize(3)
leanna.speed(10)
size = 30 


for i in range(20):                     # Choose amount of Turtle's to create 
  colored_square(leanna, size)
  size = size + 10
  leanna.forward(10)
  leanna.right(18)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).