0
how to make a hexgone of equal side length using tuple in python
I need to make a hexgone in pythone using tuple set etc and i can not make it i need help any one who can give me the solution
7 Respostas
+ 1
import turtle
t = turtle.Turtle()
numberOfSides = int(input('Enter the number of sides of a polygon: '))
lengthOfSide = int(input('Enter the length of a side of a polygon: '))
exteriorAngle = 360/numberOfSides
for i in range(numberOfSides):
t.forward(lengthOfSide)
t.right(exteriorAngle)
+ 3
import turtle # importing python turtle graphics
polygon = turtle.Turtle() # calling Turtle function from turtle library
sides = 6 # hexagon has six sides, you can make any
polygon of any no. of sides
side_length = 70 # length of each side
angle = 360.0 / sides # angle is 360 divided by no. of sides
for i in range(sides): # loop
polygon.forward(side_length) # drawing start for lengh of a side
polygon.right(angle) # right turns it clockwise
turtle.done() # prints turtle on screen
# hope you understood my language
# remember it won't work on SOLOLEARN because turtle graphics can't be
used in SOLOLEARN
# run it on python IDLE
# you can also define colors of lines, fill color etc
+ 1
JAHANGEER LATEEF WANI :D
I was curious to know what's the OP means by "make hexagon ... using tuple": you have probably found the hidden meaning of the question ;)
0
i am not getting your point of using a tuple, for what u will use tuple
0
I don't know too for what, but these are the OP question words ^^
0
message me inbox, i will make u understand
0
this is for polygon