Skip to main content

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 range(47):
    t.forward(4)
    t.left(-2)

t.done()
x = t.Turtle()


Github:

You can also get the code from here

Follow my socials:

Youtube:https://www.youtube.com/channel/UCU1qNFntn7dCi9uqyvrGKOg

Instagram: https://www.instagram.com/python.math/

Twitter:https://twitter.com/Pritish369


For any question or coding discussion, you can join my discord or telegram:

Discord:https://discord.gg/be7MmSuV

Telegram:https://t.me/Python_Math_Community

Comments