Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dca991b

Browse files
Improving Code Quality
1 parent 4f012fa commit dca991b

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

‎python_turtol_graphics/mindstroms.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import turtle
22

3-
def drw_square():
3+
def drw_square(some_turtle):
4+
for i in range(1,5):
5+
some_turtle.forward(100)
6+
some_turtle.right(90)
7+
8+
9+
def draw_art():
410
window = turtle.Screen()
511
window.bgcolor("red")
612

13+
#Create the turtle Brad - Draws a square
714
brad = turtle.Turtle()
815
brad.shape("turtle")
916
brad.color("yellow")
1017
brad.speed(2)
18+
drw_square(brad)
1119

12-
brad.forward(100)
13-
brad.right(90)
14-
brad.forward(100)
15-
brad.right(90)
16-
brad.forward(100)
17-
brad.right(90)
18-
brad.forward(100)
19-
20+
#Create the turtle Angie - Draws a circle
21+
angie = turtle.Turtle()
22+
angie.shape("arrow")
23+
angie.color("white")
24+
angie.circle(100)
2025
window.exitonclick()
2126

22-
drw_square()
27+
draw_art()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /