google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: A python program to draw hexagon using Turtle Programming

Monday, December 16, 2019

A python program to draw hexagon using Turtle Programming

Write a python program to draw hexagon using Turtle Programming :

Answer:

import turtle 
polygon = turtle.Turtle()
 
num_sides = 6
side_length = 70
angle = 360.0 / num_sides 
 
for i in range(num_sides):
    polygon.forward(side_length)
    polygon.right(angle)
     
turtle.done()

No comments:

Post a Comment

शिव भोलेनाथ स्तुति

 जय शिवशंकर, जय गंगाधर, करुणा-कर करतार हरे,   जय कैलाशी, जय अविनाशी, सुखराशि, सुख-सार हरे जय शशि-शेखर, जय डमरू-धर जय-जय प्रेमागार हरे,   जय ...