repl.it
@EdgarArcia/

Turtle 1-4

Python (with Turtle)

No description

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# The following code creates a square of different colors
#

import turtle

t = turtle.Turtle()
t.speed(0)

for c in ['red', 'green', 'yellow', 'blue']:
    t.color(c)
    t.forward(75)
    t.left(90)
t.penup()    
t.goto(-10,-10)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(95)
  t.left(90)
t.penup()
t.goto(-20,-20)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(115)
  t.left(90)
t.penup()
t.goto(-30,-30)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(135)
  t.left(90)
t.penup()
t.goto(-40,-40)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(155)
  t.left(90)
t.penup()
t.goto(-50,-50)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(175)
  t.left(90)
t.penup()
t.goto(-60,-60)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(195)
  t.left(90)
t.penup()
t.goto(-70,-70)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(215)
  t.left(90)
t.penup()
t.goto(-80,-80)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(235)
  t.left(90)
t.penup()
t.goto(-90,-90)
t.pendown()
for c in['red', 'green', 'yellow', 'blue']:
  t.color(c)
  t.forward(255)
  t.left(90)
#fills shape created
#
# Write a program that creates 10 squares of different colors, each one 
# inside of the others, alternating the color of the sides
#
result
console