Ticker

6/recent/ticker-posts

Advertisement

How to draw cool octagon shape using python.


Python source code, python projects


 Hey, coders! Today I'm going to show you how to draw a Cool octagon shape using python turtle module.  So, let's begin.


Complete source  code:

# for importing turtle module

from turtle import*

# set a speed for drawing octagon

speed(13)

# for setting a background color and line color

bgcolor("black")

color("yellow")

pensize(5)

#creaing a loop for drawing octagon

for i in range(8):

  left(45)

  for i in range(8):

   forward(100)

   right(45)

hideturtle()


Output:
      


    Hope you guys like it and don't forget to share and comment! I'll be back with another stuff. So, stay tuned and stay happy:) .















Post a Comment

1 Comments