Skip to content

Commit 4d38102

Browse files
Merge pull request kishanrajput23#85 from Rahul-chaurasiya/color-shapes
Color shapes file uploaded
2 parents 112f8bb + b8843f9 commit 4d38102

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

Diff for: ColorShapes.py

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import turtle
2+
3+
turtle.pensize(3) # Set pen thickness to 3 pixels
4+
turtle.penup() # Pull the pen up
5+
turtle.goto(-200, -50)
6+
turtle.pendown() # Pull the pen down
7+
turtle.begin_fill() # Begin to fill color in a shape
8+
turtle.color("red")
9+
turtle.circle(40, steps = 3) # Draw a triangle
10+
turtle.end_fill() # Fill the shape
11+
12+
turtle.penup()
13+
turtle.goto(-100, -50)
14+
turtle.pendown()
15+
turtle.begin_fill() # Begin to fill color in a shape
16+
turtle.color("blue")
17+
turtle.circle(40, steps = 4) # Draw a square
18+
turtle.end_fill() # Fill the shape
19+
20+
turtle.penup()
21+
turtle.goto(0, -50)
22+
turtle.pendown()
23+
turtle.begin_fill() # Begin to fill color in a shape
24+
turtle.color("green")
25+
turtle.circle(40, steps = 5) # Draw a pentagon
26+
turtle.end_fill() # Fill the shape
27+
28+
turtle.penup()
29+
turtle.goto(100, -50)
30+
turtle.pendown()
31+
turtle.begin_fill() # Begin to fill color in a shape
32+
turtle.color("yellow")
33+
turtle.circle(40, steps = 6) # Draw a hexagon
34+
turtle.end_fill() # Fill the shape
35+
36+
turtle.penup()
37+
turtle.goto(200, -50)
38+
turtle.pendown()
39+
turtle.begin_fill() # Begin to fill color in a shape
40+
turtle.color("purple")
41+
turtle.circle(40) # Draw a circle
42+
turtle.end_fill() # Fill the shape
43+
44+
turtle.color("green")
45+
turtle.penup()
46+
turtle.goto(-100, 50)
47+
turtle.pendown()
48+
turtle.write("Cool Colorful Shapes",
49+
font = ("Times", 18, "bold"))
50+
turtle.hideturtle()
51+
52+
turtle.done()

0 commit comments

Comments
 (0)