Skip to content

Commit abf4941

Browse files
authored
Update Animated_Robot.py
1 parent d1846b7 commit abf4941

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Codes on Turtle Graphics/Animated_Robot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
import time as ti
33

44
def rectangle(hor,ver,col):
5-
t.pendown()
6-
t.pensize(1)
5+
t.pendown() # to create a canvas for drawing
6+
t.pensize(1) # size of pen
77
t.color(col)
88
t.begin_fill()
99
for counter in range(1,3):
1010
t.forward(hor)
11-
t.right(90)
11+
t.right(90) #move 90 degree right
1212
t.forward(ver)
13-
t.right(90)
13+
t.right(90)
1414
t.end_fill()
1515
t.penup()
1616

1717
t.penup()
1818
t.speed('slow')
19-
t.bgcolor('Dodger blue')
19+
t.bgcolor('Dodger blue') # give background color
2020

21-
t.goto(-100,-150)
22-
rectangle(50,20,'blue')
21+
t.goto(-100,-150) # move the turtle to given coordinates
22+
rectangle(50,20,'blue') # create a rectangle of given size
2323
t.goto(-30,-150)
2424
rectangle(50,20,'blue')
2525

0 commit comments

Comments
 (0)