• Home
  • Tutorials
    • Python
    • Machine Learning
    • Pygame
    • Python Quiz
  • 100+ Projects
    • 100+ Python Projects
    • 100+ Java Projects
  • PYTHON HANDWRITTEN NOTES
    • Python Short Notes
    • Complete DSA Notes
    • Python Detailed Notes
  • Python Compiler
    • All Editors
    • Turtle Compiler
    • Online Java Compiler
    • Online C++ Compiler
    • Online C Compiler
  • Contact Us
    • About Us
    • Policy
  • Our Android Apps
    • Unlimited Python Exercises App
    • Complete Linux Commands App

CopyAssignment

We are Python language experts, a community to solve Python problems, we are a 1.2 Million community on Instagram, now here to help with our blogs.

×

Draw the Shaktiman Logo using Python Turtle

 pranjal dev  May 17, 2022
Draw the Shaktiman Logo using Python Turtle

Introduction

Hello and welcome to copyassignment.com. Many of us have watched the Shaktiman series which used to come on the Doordarshan channel. The kids and young children feel fantasized about the superhero Shaktiman and his dress. So in our today’s article, we are drawing the Shaktiman Logo using the Python Turtle module. We have used very simple lines of code that are easily understandable to all the beginners learning python.

The code contains comments so that each line of the code contains proper documentation and avoids confusion.

For the entire code with output, you can go to the bottom of the page and copy the code.

Let’s starts

Import turtle

import turtle

First, we will import the python turtle module to access inbuilt methods and functions.

function to draw the shape of a Circle

turtle.bgcolor("red")#background color is set to red

#function defined to pass the radius 
def drawshape(turtle,radius):
    turtle.circle(radius,extent=60)# initialize the radius of circle and the angle
    turtle.left(120)
    turtle.circle(radius,extent=60)

In this part, we have the function defined drawshape where we have initialized the turtle and the radius of the circle. The circle is passed with a radius and an angle of 60 degrees upon calling the function.

Create  a function to set the attributes for creating the flower

def drawflower():
    petal=turtle.Turtle()
    petal.color("yellow")
    petal.speed(0)
    petal.pensize(4)
    no_of_petals=15
    radius=145
    petal.begin_fill()
    for i in range(no_of_petals):
        drawshape(petal,radius)
        petal.left(360 /no_of_petals )
    petal.end_fill()

drawflower()

In this piece of code, we have created the function of drawflower. Here we have initialized the color, speed, pensize, number of petals, and radius of the flower. We have created another for loop where the loop will iterate 15 times. In the for loop, we are calling the drawshape function. The angle of the petal.left(24) is set for each circle i.e( petal.left(360/no_of_petals). The flower is filled with a yellow color that is created by the function drawflower.

Draw a round red circle

#draw the main round circle of Shaktiman Logo
turtle.pensize(4)
turtle.color("yellow","red")
turtle.goto(0,-94)
turtle.pendown()
turtle.begin_fill()
turtle.circle(95)
turtle.end_fill()

 In this part, we have drawn the round red circle above the flower shape. The radius is 95, and the position here is goto(0,-94).

Draw the first Triangle

#draw the first triangle
turtle.color("yellow")
turtle.begin_fill()
turtle.left(60)
turtle.forward(160)
turtle.left(120)
turtle.forward(160)
turtle.left(120)
turtle.forward(160)
turtle.end_fill()

We have drawn a simple triangle will pen color yellow with a forward(160) function to forward 160 steps and kept the angle of left 60 and left 120 degrees.

Draw the Second Triangle

#draw the second Triangle
turtle.penup()
turtle.color("red")
turtle.goto(-0,-70)
turtle.pendown()
turtle.begin_fill()
turtle.left(120)
turtle.forward(120)
turtle.left(120)
turtle.forward(120)
turtle.left(120)
turtle.forward(120)
turtle.end_fill()
turtle.penup()

In this part of the code, we have drawn the second inner triangle. It has the same function except the color is set to red. The position of the turtle is set to goto(-0,-70).

Draw the third and fourth triangle of the Shaktiman Logo using Python Turtle

#Draw the third triangle
turtle.color("yellow","yellow")
turtle.goto(80,-43)
turtle.pendown()
turtle.setheading(0)
turtle.left(120)
turtle.forward(160)
turtle.setheading(270)
turtle.right(30)
turtle.forward(160)
turtle.setheading(0)
turtle.forward(160)

#draw the fourth traingle
turtle.begin_fill()
turtle.backward(15)
turtle.left(90)
turtle.forward(10)
turtle.left(30)
turtle.forward(135)
turtle.right(30)
turtle.forward(13)
turtle.end_fill()
turtle.begin_fill()
turtle.backward(15)
turtle.left(150)
turtle.forward(138)
turtle.right(25)
turtle.forward(15)
turtle.end_fill()
turtle.pensize(9)
turtle.backward(10)
turtle.setheading(0)
turtle.forward(138)
turtle.penup()

Here, we have drawn the third and fourth triangles. For the third triangle, we have set the position to goto(80,-43). The set heading function directly points in the direction of 0 degrees i.e east and 270 degrees i.e south respectively.

Similar way, we have drawn the fourth triangle by setting the position and the turtle functions.

Draw the S Letter of Shaktiman Logo using Python Turtle

#draw the s letter of shaktiman
turtle.pensize(2)
turtle.goto(-28,-25)
turtle.pendown()
turtle.left(20)
turtle.begin_fill()
turtle.forward(10)
turtle.left(40)
turtle.forward(55)
turtle.right(30)
turtle.forward(20)
turtle.right(100)
turtle.forward(10)
turtle.right(80)
turtle.forward(15)
turtle.left(30)
turtle.forward(55)
turtle.right(27)
turtle.forward(20)
turtle.end_fill()

Here we have kept the size of the pen 2 and set the position to goto(-28,-25). From this location, we start to draw the S letter of the Shaktiman Logo. After completion filled with yellow color by using begin_fill and end_fill() functions.

Complete Code to Draw the Shaktiman Logo using Python Turtle

import turtle

turtle.bgcolor("red")
def drawshape(turtle,radius):
    turtle.circle(radius,extent=60)
    turtle.left(120)
    turtle.circle(radius,extent=60)

def drawflower():

    petal=turtle.Turtle()
    petal.color("yellow")
    petal.speed(0)
    petal.pensize(4)
    no_of_petals=15
    radius=145
    petal.begin_fill()
    for i in range(no_of_petals):
        drawshape(petal,radius)
        petal.left(360 /no_of_petals )
    petal.end_fill()

drawflower()

#draw the main round circle of Shaktiman Logo
turtle.pensize(4)
turtle.color("yellow","red")
turtle.goto(0,-94)
turtle.pendown()
turtle.begin_fill()
turtle.circle(95)
turtle.end_fill()


#draw the first triangle
turtle.color("yellow")
turtle.begin_fill()
turtle.left(60)
turtle.forward(160)
turtle.left(120)
turtle.forward(160)
turtle.left(120)
turtle.forward(160)
turtle.end_fill()

#draw the second Triangle
turtle.penup()
turtle.color("red")
turtle.goto(-0,-70)
turtle.pendown()
turtle.begin_fill()
turtle.left(120)
turtle.forward(120)
turtle.left(120)
turtle.forward(120)
turtle.left(120)
turtle.forward(120)
turtle.end_fill()
turtle.penup()

#Draw the third triangle
turtle.color("yellow","yellow")
turtle.goto(80,-43)
turtle.pendown()
turtle.setheading(0)
turtle.left(120)
turtle.forward(160)
turtle.setheading(270)
turtle.right(30)
turtle.forward(160)
turtle.setheading(0)
turtle.forward(160)

#draw the fourth triangle
turtle.begin_fill()
turtle.backward(15)
turtle.left(90)
turtle.forward(10)
turtle.left(30)
turtle.forward(135)
turtle.right(30)
turtle.forward(13)
turtle.end_fill()
turtle.begin_fill()
turtle.backward(15)
turtle.left(150)
turtle.forward(138)
turtle.right(25)
turtle.forward(15)
turtle.end_fill()
turtle.pensize(9)
turtle.backward(10)
turtle.setheading(0)
turtle.forward(138)
turtle.penup()

#draw the s letter of shaktiman
turtle.pensize(2)
turtle.goto(-28,-25)
turtle.pendown()
turtle.left(20)
turtle.begin_fill()
turtle.forward(10)
turtle.left(40)
turtle.forward(55)
turtle.right(30)
turtle.forward(20)
turtle.right(100)
turtle.forward(10)
turtle.right(80)
turtle.forward(15)
turtle.left(30)
turtle.forward(55)
turtle.right(27)
turtle.forward(20)
turtle.end_fill()

turtle.hideturtle()
turtle.done()

Output

Output of Shaktiman Logo using Python Turtle
Shaktiman Logo using Python Turtle

Here we have successfully completed drawing the Shaktiman Logo using the Python Turtle module. Please leave your comments in the comment box.

Thank you for reading this article.


Also Read:

  • Unveiling the Future of AI Detector
  • CodeWithHarry Earns 20 Lakhs per month from YouTube?
  • Cleaning Service Booking System in Python Tkinter
  • Farmers Ecommerce App using Python Tkinter
  • Guidelines for Project Collaboration Process
  • The system of the binary conversion
  • What is web development for beginners?
  • Guide to Proxy Servers: How They Work and Why You Need Them?
  • Python | Check Armstrong Number using for loop
  • Python | Factorial of a number using for loop
  • Link in bio
  • Microsoft Giving Free Machine Learning Course: Enroll Now
  • Accenture Giving Free Developer Certificate in 2023
  • Python | Asking the user for input until they give a valid response
  • Python | How to iterate through two lists in parallel?
  • Amazon Summer Internship 2023
  • Python | How to sort a dictionary by value?
  • Amazon Giving Free Machine Learning Course with Certificate: Enroll Now
  • Google Summer Internship 2023
  • Python | How to split a list into equally-sized chunks?
  • 5 Secret ChatGPT skills to make money
  • Python | Remove items from a list while iterating
  • Free Google Certification Courses
  • 5 AI tools for coders better than ChatGPT
  • Python | How to get dictionary keys as a list
  • New secrets to Earn money with Python in 2023
  • Flower classification using CNN
  • How to represent Enum in Python?
  • 5 methods | Flatten a list of lists | Convert nested list into a single list in Python
  • What does if __name__ == __main__ do in Python?
Share:
Avatar of pranjal dev

Author: pranjal dev

Post navigation

← Draw WhatsApp Logo Using Python Turtle
Draw a boat using Python Turtle →

Search….

SiteMap

Python

Machine Learning

Pygame

Data Structures and Algorithms(Python)

Python Turtle

Games with Python

All Blogs On-Site

Python Compiler(Interpreter)

Online Java Editor

Online C++ Editor

Online C Editor

All Editors

Services(Freelancing)

Recent Posts

  • Unveiling the Future of AI Detector
  • CodeWithHarry Earns 20 Lakhs per month from YouTube?
  • Cleaning Service Booking System in Python Tkinter
  • Farmers Ecommerce App using Python Tkinter
  • Guidelines for Project Collaboration Process

Must Read

  • 100+ Python Projects
  • 100+ Java Projects
  • Python Programs
  • JavaScript Projects
  • Java Projects
  • PHP Projects

RoadMap to Learn

  • Python
  • Java
  • JavaScript

Python Handwritten Notes

Click Here to buy now

Python Assignment Help

We also deal with Python Assignments, Homeworks, and Projects. Click Here, to get your Python work done by experts.

© Copyright 2019-2023 www.copyassignment.com. All rights reserved. Developed by copyassignment