forked from lukman467/coding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
happy birthday_2.py
77 lines (64 loc) · 1.53 KB
/
happy birthday_2.py
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
import turtle
bg = turtle.Screen()
bg.bgcolor("black")
turtle.pensize(3)
turtle.hideturtle()
turtle.penup()
turtle.goto(-165, -180)
turtle.color("white")
turtle.pendown()
turtle.forward(330)
turtle.penup()
turtle.goto(-155, -150)
turtle.color("white")
turtle.pendown()
turtle.forward(305)
turtle.penup()
turtle.goto(-145, -120)
turtle.color("white")
turtle.pendown()
turtle.forward(280)
turtle.penup()
turtle.goto(-95, -100)
turtle.color("pink")
turtle.begin_fill()
turtle.pendown()
turtle.forward(190)
turtle.left(90)
turtle.forward(95)
turtle.left(90)
turtle.forward(190)
turtle.left(90)
turtle.forward(95)
turtle.end_fill()
positions = [-75, -25, 25, 75]
colors = ["red", "blue", "yellow", "green"]
for i, pos in enumerate(positions):
turtle.penup()
turtle.goto(pos, 20)
turtle.color(colors[i])
turtle.pendown()
turtle.forward(20)
for pos in positions:
turtle.penup()
turtle.goto(pos, 30)
turtle.color("red")
turtle.pendown()
turtle.forward(3)
turtle.penup()
turtle.goto(10, -60)
turtle.pendown()
circle_colors = ["red", "orange", "brown", "green", "blue", "purple", "grey"]
for each_color in circle_colors:
angle = 360 / len(circle_colors)
turtle.color(each_color)
turtle.circle(10)
turtle.right(angle)
turtle.forward(10)
turtle.penup()
turtle.goto(-160, 50)
turtle.color("white")
turtle.pendown()
turtle.write("happy birthday to you<3", font=("Poppins", 25, "normal"))
turtle.color("lightblue")
turtle.done()