Draw Unlimited Colors Hexagons | Full Python Code ||

Published: 26 November 2022
on channel: TechniqueCoding
92
3

Code :
import turtle
from random import randint

x=20

ga=20

turtle.speed(100)

turtle.colormode(255)

def move(l,a):
turtle.right(a)
turtle.forward(l)

def hex():
turtle.pendown()
turtle.color(randint(0,255),randint(0,255),randint(0,255))
turtle.begin_fill()
for i in range(6):
move(x,-60)
turtle.end_fill()
turtle.penup()

turtle.penup()
for an in range(ga):
if an==0:
hex()
move(x,-60)
move(x,-60)
move(x,-60)
move(0,180)
for i in range(6):
move(0,60)
for j in range(an+1):
hex()
move(x,-60)
move(x,60)
move(-x,0)
move(-x,60)
move(x,-120)
move(0,60)

turtle.exitonclick()

#colorhexagons #pythonturtle #codingtechnique #100pythonpracticecode


On this page of the site you can watch the video online Draw Unlimited Colors Hexagons | Full Python Code || with a duration of hours minute second in good quality, which was uploaded by the user TechniqueCoding 26 November 2022, share the link with friends and acquaintances, this video has already been watched 92 times on youtube and it was liked by 3 viewers. Enjoy your viewing!