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

Age and Gender Detection In Python - Creation Code

Gender Identity: Gender identity is the personal sense of one's own  gender . Gender identity can correlate with a person's  assigned sex  or can differ from it. In most individuals, the various biological determinants of sex are congruent and consistent with the individual's gender identity.  Gender expression  typically reflects a person's gender identity, but this is not always the case. While a person may express behaviors, attitudes, and appearances consistent with a particular  gender role , such expression may not necessarily reflect their gender identity. The term gender identity was coined by  Robert J Stoller  in 1964. Modules and assets: In this project, we will use the assetsOpenCV library which will help us to play with the camera  We also use some datasets to identify the faces and ages you can find those datasets  here Explanation: We will first train our models test.py import cv2 def faceBox ( net , frame , conf_thresho...

Create Ping Pong Game in Python

  Ping Pong Game: Table tennis , also known as  ping-pong  and  whiff-whaff , is a sport in which two or four players hit a lightweight ball, also known as the ping-pong ball, back and forth across a table using small rackets. The game takes place on a hard table divided by a net. Except for the initial serve, the rules are generally as follows: players must allow a ball played toward them to bounce once on their side of the table and must return it so that it bounces on the opposite side at least once. A point is scored when a player fails to return the ball within the rules. Play is fast and demands quick reactions. Spinning the ball alters its trajectory and limits an opponent's options, giving the hitter a great advantage. We can make it using pygame but I keep it more simple we will create this game using only the turtle module so let's drive into the code without wasting any time Code: # Import required library import turtle # Create screen sc = turtle . Scre...

How To Draw BMW Logo - In Python

 I know I don't need to introduce BMW as it is a very popular luxury car. Today we gonna draw the BMW logo in python. I know that you can draw it using a pencil and other tools like AutoCAD etc. But we are programmers we talk with computers so let's tell our computer to draw this logo for use with the help of python. Module The only module we will use is that turtle Code: import turtle as t t.begin_fill() t.fillcolor( '#008ac9' ) for i in range ( 50 ):     t.forward( 4 )     t.left( 2 ) t.right(- 80 ) t.forward( 116 ) t.right(- 90 ) t.forward( 132 ) t.end_fill() t.penup() t.pendown() t.right( 90 ) for i in range ( 50 ):     t.forward( 4 )     t.left(- 2 ) t.right( 80 ) t.forward( 116 ) t.forward(- 116 ) t.right( 90 ) t.begin_fill() t.fillcolor( '#008ac9' ) for j in range ( 45 ):     t.forward(- 4 )     t.left(- 2 ) t.right(- 90 ) t.forward( 116 ) t.end_fill() t.right( 180 ) t.forward( 116 ) t.right( 90 ) for i in ...