Python Turtle Graphics - 13 | Can you draw the JS Logo using Python | #Programing #Python #Viral

preview_player
Показать описание
Music credit : NCS
Source Code :
from turtle import *
bgcolor("black")
speed(10)
#First Rectangle
x=-200
y=200
penup()
goto(x,y)
pendown()
pencolor("white")
fillcolor("gold")
begin_fill()
fd(400)
rt(95)
fd(500)
rt(75)
fd(165)
rt(20)
fd(165)
rt(75)
fd(500)
rt(95)
fd(20)
end_fill()
#Second Rectangle
penup()
x=0
y=200
goto(x,y)
pendown()
fillcolor("yellow")
begin_fill()
seth(270)
penup()
x=0
y=160
goto(x,y)
pendown()
fd(450)
lt(100)
fd(145)
lt(75)
fd(430)
lt(95)
fd(180)
lt(90)
fd(20)
end_fill()
#Writng S
fillcolor("black")
penup()
x=130
y=110
goto(x,y)
pendown()
pencolor("black")
begin_fill()
seth(180)
fd(100)
lt(90)
fd(150)
lt(90)
fd(90)
rt(90)
fd(70)
rt(90)
fd(100)
lt(90)
fd(30)
lt(90)
fd(127)
lt(90)
fd(140)
lt(92)
fd(80)
rt(90)
fd(80)
rt(90)
fd(80)
lt(90)
fd(31)
lt(90)
fd(10)
end_fill()

#Wrting J
fillcolor("Ghostwhite")
penup()
x=-20
y=110
goto(x,y)
pendown()
seth(270)
begin_fill()
fd(250)
rt(95)
fd(120)
rt(90)
fd(40)
rt(90)
fd(75)
lt(95)
fd(215)
rt(90)
fd(40)
rt(90)
fd(20)
end_fill()
hideturtle()
done()
Рекомендации по теме