Skip to main content

How to draw batman logo using python| Batman logo using turtle



Why choose python

Well if you are a beginer in coding or you are an advance coder then you know that we can create animiation in C and C++ language. But I will said that if you are a beginer then you should start with a simple and easy language whic is python. For this reason we choose python.

Only animation?

If you are thinking that the power of programming languages is only to drawing. Then you are absolutly wrong. The power of coding is unlimited you can use python to automate a system even hackers also use python wisely hence it has easy commond and syntax. We use to draw some interesting stuffs because it will increase your will to learn coding. As the time will go we will dive into some advance project. So don't  be bored just stay tuned.

What is required module

We will use the turtle module in this project.

Logic of the project

Well we will not use any heigh level algorithm which can be tough for you to understand. We just use a simple method. A method to draw a curve in turtle using for loop. By joining the small curve with other small curve we can create the logo. Because the logo is basically a summation of  small curves. So it will not be so hard to understand. Still if you can't understand it you can comment. I will try to explain more easily.

Source Code

from turtle import *
speed(250)
bgcolor('#fcb103')
penup()
goto(-200,100)
pendown()
fillcolor('black')
begin_fill()
def upper_part():
    forward(150)
    right(90)
    for i in range(55):
        forward(0.3)
        left(1)
    for i in range(50):
        forward(0.2)
        left(0.5)
    left(10)
    forward(20)
    # start of the sing
    left(80)
    forward(17)
    right(160)
    forward(10)
    left(80)
    # end of the sing
    forward(17)
    left(80)
    forward(10)
    right(160)
    forward(17)
    left(80)
    forward(10)
    for i in range(50):
        left(0.5)
        forward(0.2)
    for i in range(55):
        forward(0.3)
        left(1)
    right(80)
    forward(150)
    left(180)
upper_part()
def lower_part():
    left(5)

    for i in range(30):
        forward(1.5)
        left(1)
    for i in range(48):
        forward(1)
        left(1.5)
    right(110)
    forward(55)

    for i in range(35):
        forward(2)
        left(1)
    for i in range(36):
        forward(0.6)
        left(1)
    right(136.5986)

    for i in range(36):
        left(1)
        forward(0.6)
    for i in range(35):
        left(1)
        forward(2)
    forward(55)
    right(110)
    for i in range(48):
        left(1.5)
        forward(1)
    for i in range(30):
        left(1)
        forward(1.5)

    hideturtle()
lower_part()
end_fill()
done()

Result


Also check our instagram page


 

Comments

Popular posts from this blog

Draw Minecraft Charater in Python

  Minecraft  is a  sandbox video game  developed by the Swedish video game developer  Mojang Studios . The game was created by  Markus "Notch" Persson  in the  Java programming language . Following several early private testing versions, it was first made public in May 2009 before fully releasing in November 2011, with  Jens Bergensten  then taking over development.  Minecraft  has since been ported to several other platforms and is the  best-selling video game of all time , with over 238 million copies sold and nearly 140 million  monthly active users  as of 2021 . We gonna build a character of Minecraft using our creativity and coding skills so let's drive into the code: Code: import turtle as t def eye ( r , a ):     t . fillcolor ( 'brown' )     t . begin_fill ()     t . circle ( r , a )     t . end_fill () t . begin_fill () t . fillcolor (...

Draw spiderman logo using python | spiderman logo with python turtle

Well like me I think you are also a fan of spiderman. We also do coding so let's create our favorite superhero in python and have some fun with it Module: We only use one simple module in this project that is Turtle Code: from turtle import * bgcolor ( 'red' ) pensize ( 10 ) fillcolor ( 'black' ) begin_fill () circle ( 20 ) end_fill () penup () right ( 90 ) forward ( 5 ) pendown () fillcolor ( 'black' ) begin_fill () right ( 60 ) for i in range ( 6 ):     forward ( 50 )     left ( 60 ) end_fill () penup () left ( 150 ) forward ( 39 ) left ( 90 ) forward ( 9 ) pendown () forward ( 25 ) right ( 60 ) forward ( 15 ) left ( 60 ) forward ( 25 ) penup () backward ( 25 ) right ( 60 ) back ( 15 ) left ( 60 ) backward ( 25 ) left ( 60 ) pendown () backward ( 35 ) left ( 120 ) forward ( 80 ) penup () left ( 40 ) forward ( 30 ) left ( 140 ) pendown () forward ( 110 ) left ( 60 ) forward ( 40 ) right ( 60 ) forward ( 7 ) right ( 60 ) forward ( 20 ) left ( 60 ) forw...

Walking Cat Animation using Pure CSS and HTML

  Showing your creativity with coding is really awesome and fun. This is the post where the creativity is the CSS. So enjoy the code and try to show your creativity. HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>walking Cat</title>     <link rel="stylesheet" href="style.css"> </head> <body>         <div id="marco">           <div id="cielo"></div>                 <div id="luna"></div>                 <div id="gato"></div>                 <div id="muro"></div>       ...