-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindian-flag.py
More file actions
78 lines (65 loc) · 1.5 KB
/
indian-flag.py
File metadata and controls
78 lines (65 loc) · 1.5 KB
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
import turtle
turtle.penup()
turtle.goto(-200, 100)
turtle.setup(width=1100, height=700, startx=None, starty=None)
# this will create the orange part for the flag
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor('#FF9933')
turtle.left(90)
turtle.forward(90)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(90)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()
# to create the white part and Ashok chakra!!!
turtle.left(90)
turtle.forward(90)
turtle.left(90)
turtle.forward(200)
turtle.circle(45)
# to draw the spokes in the chakra
turtle.penup()
turtle.goto(0,55)
turtle.color('blue')
for spoke in range(0,24):
turtle.goto(0,55)
turtle.right(15)
turtle.pendown()
turtle.forward(45)
turtle.penup()
turtle.goto(0,10)
turtle.pendown()
turtle.color('black')
turtle.forward(200)
turtle.left(90)
turtle.forward(90)
turtle.penup()
turtle.goto(-200,10)
turtle.right(180)
# this will print the green part
turtle.begin_fill()
turtle.fillcolor('#138808')
turtle.pendown()
turtle.forward(90)
turtle.left(90)
turtle.forward(400)
turtle.left(90)
turtle.forward(90)
turtle.end_fill()
# stick for the flag
turtle.penup()
turtle.goto(-200,-80)
turtle.right(180)
turtle.pendown()
turtle.forward(200)
turtle.penup()
turtle.goto(-150,-170)
turtle.color('deep sky blue')
style= ('Courier', 30, 'italic', 'bold')
turtle.write('HAPPY INDEPENDENCE DAY', font=style, align='left')
turtle.hideturtle()
turtle.done()