26
0

Python Project – Make Captain America Shield using Python

26
0
Python Project - Make Captain America Shield using Python

In this Python Project, we have created a Captain America Shield using Python programming with the help of the turtle module in Python.

Source Code for this Python Project

import turtle
import math

kachhua = turtle.Turtle()

wn = turtle.Screen()
wn.bgcolor("#000042")


def func1(x, y):
    kachhua.penup()
    kachhua.goto(x, y)
    kachhua.pendown()
    kachhua.setheading(0)
    kachhua.pensize(2)
    kachhua.speed(10)


def func2(r, color):
    x_point = 0
    y_point = -r
    func1(x_point, y_point)
    kachhua.pencolor(color)
    kachhua.fillcolor(color)
    kachhua.begin_fill()
    kachhua.circle(r)
    kachhua.end_fill()


def func3(r, color):
    func1(0, 0)
    kachhua.pencolor(color)
    kachhua.setheading(162)
    kachhua.forward(r)
    kachhua.setheading(0)
    kachhua.fillcolor(color)
    kachhua.begin_fill()
    for i in range(5):
        kachhua.forward(math.cos(math.radians(18)) * 2 * r)
        kachhua.right(144)
    kachhua.end_fill()
    kachhua.hideturtle()


if __name__ == '__main__':
    func2(288, "#AA1428")
    func2(234, "#ffffff")
    func2(174, "#AA1428")
    func2(114, "#000042")
    func3(114, "#ffffff")
    turtle.done()

Demo Video

https://youtu.be/BgVIdaX2LnQ

Kindly Subscribe to our Youtube channel for more awesome python projects. Let me know in the comments if you want any specific python project.

Screenshot

python project - make captain america shield using python

 

If you liked this, click the 💚 below so other people will see this here on Xalgord. Please let me know if you have any comments! Feel free to connect on Instagram.

xalgord
WRITTEN BY

xalgord

Highly motivated, Hard-working, and Resourceful Programmer. I Love To Explain And Teach Technology, Solve Tech Problems And Learn Something New Every Day.

Leave a Reply