六角形的不同颜色的线

问题描述

我只是想知道如何在六边形的每一行上获得不同的颜色。下面是所需的输出和输入。

立即输出-Link to output right now

我想要的输出-Link to output I want

import turtle as trtl

colors = ["#9c2921","#cf8e04","#f5d905",]

#--------------------
num_sides = int(input("Enter the number of sides(Enter 6 to get the output of the real image): "))

if num_sides == 6:
  print("Desired artwork is displayed")

side_length = 25
circumradius = side_length


angle = 360/len(colors)
trtl.width(10)



for color in colors:
    trtl.color(color)
    trtl.pensize(10)
    for move_turtle in range(1):
      trtl.penup()
      trtl.sety(-circumradius)
      trtl.pendown()
      trtl.circle(circumradius,steps = num_sides)

      circumradius *= 2

trtl.hideturtle()


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)