March 30, 2019 -import turtle turtle.showturtle() turtle.shape("turtle") turtle.fillcolor("green") turtle.beginfill() turtle.forward(50) turtle.right(90) turtle.forward(50) turtle.right(90) turtle.forward(50) turtle.right(90) turtle.forward(50) turtle.right(90) turtle.endfill() February 23, 2026 -If you ever need to know them, ... possible to build up geometric patterns:for steps in range(100): for c in ('blue', 'red', 'green'): color(c) forward(steps) right(30)- which of course, are limited only by the ... ] Then, within yourloop, choose acolorfrom the list. You need to convert i, which goes from 0 to 999, into an index which goes from 0 to the size of the list. This is most easily done by dividing by ten and converting to an integer. You can then set thecolorof theturtleusingturtle.color.See more on stackoverflow Jul 5, 2020 ·turtle.color() method is a function of theturtlemodule in Python used to change thecolorof theturtle’s pen and fill. It allows us to customize the appearance of shapes drawn by theturtleby specifying colors usingcolornames, RGB values, or hex codes. Jun 26, 2025 ·Learn how to use colors effectively in PythonTurtlegraphics, from basic named colors to RGB and hex codes, and how to create gradients for stunning visuals. May 18, 2025 ·🐢Ultimate guide to PythonTurtlecolors! 🌈Fullcolorlist. Use fillcolor, backgroundcolor, hex, RGB colors in Pythonturtlegraphics art. FillColor Set's theturtle'sfillcolor. The fillcolorcan be set to any HTML/CSS recognizedcolorstring. More information on HTML colors can be found here. pencolor("{color}") # Sets the fillcolorto light grey t. fillcolor ("#CCCCCC") This method can also used by providing an amount of red, green, blue, and opactity (alpha). The body of the loop only draws one side of the square. It will be repeated once for each item in the list. However, the color of the turtle never changes. October 21, 2021 -Hey, I am working on a code to draw 20 circles with radius 20 and offset of 10 and every 5 circles change the color However, i managed to make the 20 circles by making a loop and done the offset as well, but I'm stuck in the coloring part · Any support please i need to add pencolor that changes every 5 circles without the need to make another loop Share ...
Python program to demonstrate # circle drawing import turtle # Initializing the turtle t = turtle.Turtle() t.hideturtle() # offset of the circle r = 10 # Loop for printing concentric circles for i in range(5): t.circle(r i) #radius t.up() t.sety((r i) * (-1)) #t.pencolor("red") t.pensize(2) #t.pencolor("blue") t.down() turtle.done() The turtle can draw in different 15 colors.The command for changing the pen's color issetcolor followed by the color's number.For example: setcolor 15 Set the color to color number 8 and go forward 50 points