How do I draw a hexagon using the turtle module of python

0 votes
How do I draw a hexagon using the turtle module of python? I'm very new to this module and need it for an assignment. Any help will be appreciated. Thank you
Jun 22, 2019 in Python by Jinu
7,367 views

1 answer to this question.

–1 vote

Hey @Jinu, try this:

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() 
answered Jun 23, 2019 by Haseeb

Related Questions In Python

0 votes
1 answer

How do I create a star using the turtle module of python?

Hey @Jinu, Try something like this: import turtle star = ...READ MORE

answered Jun 22, 2019 in Python by Neha
1,556 views
0 votes
1 answer

How do I draw a semi-circle only using turtle - Python

Try this: import turtle turtle = turtle.Pen() turtle.left(90) for x in ...READ MORE

answered Jul 6, 2019 in Python by Bheem
10,210 views
+2 votes
1 answer

How can I record the X,Y limits of a displayed X,Y plot using the matplotlib show() module?

A couple hours after posting this question ...READ MORE

answered Dec 27, 2018 in Python by anonymous
1,143 views
+1 vote
1 answer
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,070 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP