• 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:

  • Top 25 Pattern Programs in C++
  • Currency Converter in C++
  • SQLite | CRUD Operations in Python
  • Number Guessing Game in C++
  • Image background remover in Python
  • C++ Project Structure
  • Python | Check if a string is a palindrome or not without Recursion
  • Python | Check if a number is an Armstrong Number or not using Recursion
  • Python | Check if a number is an Armstrong Number or not without using Recursion
  • Python | Shuffle a list using recursion
  • Python | Shuffle a list without recursion
  • Python | Implementing switch case using functions
  • Python function to check whether a number is perfect or not
  • Python | Find LCM using function
  • Python | Find HCF using function
  • Python | Convert the binary number to decimal without using library function
  • Python | Create a basic operations calculator(+, -, /, and x), create a separate function for each operation
  • Python | Detecting the number of local variables declared in a function
  • Python | Making a chain of function decorators (bold italic underline etc)
  • Python | Access function inside a function
  • Event Management System Project in Python
  • ATM machine program in C++
  • Python | Create a function with a pass statement
  • Python | Function to calculate the square root of a number
  • Python | A function that calculates the power of a number
  • Python | A function that accepts 2 integers and adds them and returns their sum
  • Python | Function that takes a list of integers and returns the last integer
  • Python | Return multiple values from a function
  • Python function that takes a list and returns a new list with unique elements of the first list
  • Python | Generate a random number in the range of 1 to 10 using the function
Share:
Avatar of pranjal dev

Author: pranjal dev

Post navigation

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

Categories

30 Days of Code allcategorites assignment c and cpp competitive programming data structures and algorithms django tutorial final year project game in python general-python gfg github-copy gui java project gui python projects how-to html css javascript project java java game projects java projects job leetcode Machine Learning ml-shorts ml ai ds project php projects programs in python project ideas pygame tutorial python-error python-short-tutorial python projects python simple programs python sqlite qna python turtle python very small program assignments tutorial web projects

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

  • Top 25 Pattern Programs in C++
  • Currency Converter in C++
  • SQLite | CRUD Operations in Python
  • Number Guessing Game in C++
  • Image background remover in Python

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.

close button

© Copyright 2022 www.copyassignment.com. All rights reserved. Developed by copyassignment