2019.06.10(am): How to draw graphic using hexagon with python turtle

fd() means forward, bk() means back and rt() or It() means tilt right by certain angle.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
from turtle import *
speed(0)
pencolor('white')
bgcolor('black')
x = 0
up()
rt(45)
fd(90)
rt(135)
down()
while x < 120:
fd(200)
rt(61)
fd(200)
rt(61)
fd(200)
rt(61)
fd(200)
rt(61)
fd(200)
rt(61)
fd(200)
rt(61)
rt(11.1111)
x = x+1
exitonclick()
from turtle import * speed(0) pencolor('white') bgcolor('black') x = 0 up() rt(45) fd(90) rt(135) down() while x < 120: fd(200) rt(61) fd(200) rt(61) fd(200) rt(61) fd(200) rt(61) fd(200) rt(61) fd(200) rt(61) rt(11.1111) x = x+1 exitonclick()
from turtle import * 

speed(0)
pencolor('white') 
bgcolor('black') 

x = 0
up()
rt(45) 
fd(90)
rt(135)
down()

while x < 120: 
    fd(200)     
    rt(61)
    fd(200)
    rt(61)
    fd(200)
    rt(61)
    fd(200)
    rt(61)
    fd(200)
    rt(61)
    fd(200)
    rt(61)

    rt(11.1111) 
    x = x+1 

exitonclick() 

Leave a Reply