-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmandala.py
More file actions
40 lines (31 loc) · 702 Bytes
/
Copy pathmandala.py
File metadata and controls
40 lines (31 loc) · 702 Bytes
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
#!/usr/bin/env python3
"""
Draw a triangle
Version: 1.0
Python 3.12+
Author: PedroManuelAtienzaHuerta
Date created: January 27th, 2025
Date modified: -
"""
import turtle
# Initial setup
screen = turtle.Screen()
screen.bgcolor("white")
mandala = turtle.Turtle()
mandala.speed(0)
# Function to draw a circle
def draw_circle(color, radius, x, y):
mandala.penup()
mandala.color(color)
mandala.goto(x, y)
mandala.pendown()
mandala.circle(radius)
# Draw mandala pattern
colors = ["red", "blue", "green", "yellow", "white", "orange"]
radius = 50
for i in range(6):
draw_circle(colors[i], radius, 0, 0)
mandala.right(70)
# Finish drawing
mandala.hideturtle()
turtle.done()