Square-in-Square Design using Python's Turtle
A code to draw a square-in-square design using the Turtle programming in Python
Welcome to the code! Here’s a simple code for drawing a beautiful square-in-square design using Turtle programming.
In this code, we used a turtle named “s” to draw the square-in-square design
“turtle.begin_fill()” is called just before drawing a shape to be filled. “turtle.end_fill()” is used to fill the shape drawn after the last call to begin_fill().
“turtle.fillcolor(*args)” return or sets the fillcolor.
Four input formats are allowed:
Return the current fillcolor as color specification string, possibly in tuple format (see example). May be used as input to another color/pencolor/fillcolor call.
Set fillcolor to colorstring, which is a Tk color specification string, such as “red”, “yellow”, or “#33cc8c”.
- fillcolor((r, g, b))
Set fillcolor to the RGB color represented by the tuple of r, g, and b. Each of r, g, and b must be in the range 0..colormode, where colormode is either 1.0 or 255 (see colormode()).
- fillcolor(r, g, b)
Set fillcolor to the RGB color represented by r, g, and b. Each of r, g, and b must be in the range 0..colormode.
If the turtle shape is a polygon, the interior of that polygon is drawn with the newly set fillcolor.
Note: Loved the post? You too can publish your article on “Python for fun” which will be loved by millions. Contribute an article!