Introduction
The principles are required to draw any forms using Python Turtle, in this case, we will be drawing a very simple Galactic Flower Using Python Turtle. If you think about it, our galactic flower just circles (of various forms and colors) drawn in a non-overlapping pattern.
The turtle has three qualities: a location, an orientation (or direction), and a pen. The pen’s attributes include color, width, and on/off state (also called down and up).
The turtle responds to directions such as “go ahead 10 spaces” and “turn left 90 degrees” based on its present location. You can also control the turtle’s pen by activating it, altering its color, and modifying its breadth. A student can comprehend (and foresee and reason about) the turtle’s movement by picturing what they would do if they were the turtle.
Step 1. We are just importing the Python turtle library below.
import turtle
window = turtle.Screen()
window.bgcolor('black')
window.title("Galactic Flower made for Follow Tutorials")
First of all, we import the library, and then set the background color and set the Title.
Step 2. Create 2nd Instance.
galatic = turtle.Turtle()
galatic.speed(2)
galatic.color('white')
Create a turtle object and assign it a preferred speed and color, in this case, white and speed 2.
Step 3. Assigning 180 as an integer to rotate.
rotate=int(180)
Step 4. Define Circles function
def Circles(t,size):
for i in range(10):
t.circle(size)
size=size-4
Step 5. Define 2nd drawCircles function
def drawCircles(t,size,repeat):
for i in range (repeat):
Circles(t,size)
t.right(360/repeat)
Complete Code to Draw a Galactic Flower Using Python Turtle
import turtle window = turtle.Screen() window.bgcolor('black') window.title("Galactic Flower made for Follow Tutorials") galatic = turtle.Turtle() galatic.speed(20) galatic.color('white') rotate=int(180) def Circles(t,size): for i in range(10): t.circle(size) size=size-4 def drawCircles(t,size,repeat): for i in range (repeat): Circles(t,size) t.right(360/repeat) drawCircles(galatic,150,10) t1 = turtle.Turtle() t1.speed(20) t1.color('yellow') rotate=int(90) def Circles(t,size): for i in range(4): t.circle(size) size=size-10 def drawCircles(t,size,repeat): for i in range (repeat): Circles(t,size) t.right(360/repeat) drawCircles(t1,130,10) t2= turtle.Turtle() t2.speed(20) t2.color('blue') rotate=int(80) def Circles(t,size): for i in range(4): t.circle(size) size=size-5 def drawCircles(t,size,repeat): for i in range (repeat): Circles(t,size) t.right(360/repeat) drawCircles(t2,110,10) t3 = turtle.Turtle() t3.speed(20) t3.color('red') rotate=int(90) def Circles(t,size): for i in range(4): t.circle(size) size=size-19 def drawCircles(t,size,repeat): for i in range (repeat): Circles(t,size) t.right(360/repeat) drawCircles(t3,80,10) t4= turtle.Turtle() t4.speed(20) t4.color('green') rotate=int(90) def Circles(t,size): for i in range(4): t.circle(size) size=size-20 def drawCircles(t,size,repeat): for i in range (repeat): Circles(t,size) t.right(360/repeat) drawCircles(t4,40,10) turtle.done()
Output:
Keep visiting the website for more articles on different python topics.
Thank you for reading this article.
Also Read:
- Draw an Android Logo using Python Turtle
- Create a Stopwatch Using Python Tkinter
- Draw Snowman using Python Turtle
- Draw The Great Indian Flag using Python Turtle
- Draw a Dog using Python Turtle
- Draw a Fish Using Python Turtle
- Draw a Heart Using Python Turtle
- Draw a Christmas Tree using Python Turtle
- Draw Olympic logo using Python Turtle
- Draw Audi Logo in Python Turtle
- Draw Car using Python Turtle
- Draw Penguin using Python Turtle
- Draw Panda using Python Turtle
- Cat using Python Turtle
- Creating a Telegram Bot Using Python
- Get weather forecast using Python
- Hangman Game using Python
- Chess Board using Python
- Google Logo in Python Turtle
- Balloon Shooter Game using Python PyGame
- Complete PyGame Tutorial and Projects
- Draw Windows logo using Python Turtle
- Library Management System Python Project with source code | GUI and Database
- Beginners to Advanced Python Turtle Projects
- Draw Netflix Logo using Python Turtle
- Flappy Bird In Python Pygame with source code
- Create Your Own Web Browser Using Python
- Deploy Machine Learning model using Streamlit
- Tic Tac Toe using Python Project with source code
- Make A Telegram Bot Using Python