-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiff.py
More file actions
34 lines (27 loc) · 717 Bytes
/
iff.py
File metadata and controls
34 lines (27 loc) · 717 Bytes
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
# It makes the fourth side blue.
import turtle
jack = turtle.Turtle()
jack.color("yellow")
for side in range(4):
if side == 3:
jack.color("blue")
jack.forward(100)
jack.right(90)
# The whole square would be yellow, because it would not change the color to blue until after drawing the fourth side.
import turtle
jack = turtle.Turtle()
jack.color("yellow")
for side in range(4):
jack.forward(100)
jack.right(90)
if side == 3:
jack.color("blue")
# It makes both the third and fourth sides blue.
import turtle
jack = turtle.Turtle()
jack.color("yellow")
for side in range(4):
if side == 2:
jack.color("blue")
jack.forward(100)
jack.right(90)