Draw Shape inside Shape in Python Using Turtle Last Updated : 16 Sep, 2021 Comments Improve Suggest changes Like Article Like Report Prerequisites: Turtle Programming in Python Turtle is a Python feature like a drawing board, which let us command a turtle to draw all over it! We can use many turtle functions which can move the turtle around. Turtle comes in the turtle library. The turtle module can be used in both object-oriented and procedure-oriented ways. Some of the commonly used methods which are also used here are: forward(length): moves the pen in the forward direction by x unit.backward(length): moves the pen in the backward direction by x unit.right(angle): rotate the pen in the clockwise direction by an angle x.left(angle): rotate the pen in the anticlockwise direction by an angle x.penup(): stop drawing of the turtle pen.pendown(): start drawing of the turtle pen. In this article, we will draw various shape inside a similar shape like drawing triangles inside triangle. Triangle inside Triangle Follow the below steps: Define an instance for turtle.For a square execute a loop 3 times (sides).In every iteration move turtle 120 units forward.This will make up a Triangle.This is made multiple times to form triangles inside the triangle using a function. Below is the python implementation. Python3 # import the turtle modules import turtle # define the function # for triangle def form_tri(side): for i in range(3): my_pen.fd(side) my_pen.left(120) side -= 10 # Forming the window screen tut = turtle.Screen() tut.bgcolor("green") tut.title("Turtle") my_pen = turtle.Turtle() my_pen.color("orange") tut = turtle.Screen() # for different shapes side = 300 for i in range(10): form_tri(side) side -= 30 Output : Square inside Square Follow the below steps: Define an instance for turtle.For a square execute a loop 4 times (sides).In every iteration move turtle 90 units forward.This will make up a Square.This is made multiple times to form squares inside squares using a function. Below is the python implementation. Python3 # import the turtle modules import turtle # define the function # for square def form_sq(side): for i in range(4): my_pen.fd(side) my_pen.left(90) side -= 5 # Forming the window screen tut = turtle.Screen() tut.bgcolor("green") tut.title("Turtle") my_pen = turtle.Turtle() my_pen.color("orange") tut = turtle.Screen() # for different shapes side = 200 for i in range(10): form_sq(side) side-= 20 Output : Hexagon inside Hexagon Follow the below steps: Define an instance for turtle.For a hexagon execute a loop 6 times (sides).In every iteration move turtle 300 units forward.This will make up a Hexagon.This is made multiple times to form hexagons inside the hexagon using a function. Below is the python implementation. Python3 # import the turtle modules import turtle # define the function # for hexagon def form_hex(side): for i in range(6): my_pen.fd(side) my_pen.left(300) side -= 2 # Forming the window screen tut = turtle.Screen() tut.bgcolor("green") tut.title("Turtle") my_pen = turtle.Turtle() my_pen.color("orange") tut = turtle.Screen() # for different sizes side = 120 for i in range(5): form_hex(side) side -= 12 Output : Comment More infoAdvertise with us Next Article Draw Shape inside Shape in Python Using Turtle D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads Draw tree using Turtle module in Python Prerequisite: Turtle module, Drawing Triangle, Drawing Rectangle There are many modules in python which depicts graphical illustrations, one of them is turtle, it is an in-built module in Python, which lets the user control a pen(turtle) to draw on screen(drawing board). It is mostly used to illustr 2 min read Draw sun using Turtle module in Python Prerequisite: Turtle Programming in Python In this article, let's learn how to draw the Sun using turtle in Python. Turtle is an inbuilt module in Python. It helps draw patterns by providing a screen and turtle (pen) as tools. To move the turtle as desired functions defined within the module like fo 1 min read Draw Spiraling Square using Turtle in Python Prerequisite: Python Turtle Basic Turtle is an inbuilt module of python. It enables us to draw any drawing by a turtle, methods defined in the turtle module and by using some logical loops. To draw something on the screen(cardboard) just move the turtle(pen). To move turtle(pen) there are some funct 1 min read Draw Spiraling Star using Turtle in Python Prerequisite: Python Turtle Basics Turtle is an inbuilt module of python. It enables us to draw any drawing by a turtle and methods defined in the turtle module and by using some logical loops. To draw something on the screen(cardboard) just move the turtle(pen).To move turtle(pen) there are some fu 1 min read Print a Spirograph using turtle in Python Pre-requisites: Turtle Programming in Python A spirograph is a very interesting geometrical figure which is often symmetrical to both the axes. It produces mathematical roulette curves of the variety technically known as hypotrochoids and epitrochoids. Here, we've used a range of colors to draw circ 1 min read Like