Draw Triangle In Python Using Turtle Module
Last updated July 3, 2023 by Jarvis Silva
In this tutorial we will see how to draw a triangle in python turtle, turtle module is a GUI python library which can be used to draw anything from characters, cartoons, shapes and other objects.
Python Code To Draw Triangle
import turtle as t
t.bgcolor("#eeeeee")
t.fillcolor("red")
t.begin_fill()
t.pendown()
for i in range(3):
t.forward(300)
t.left(120)
t.end_fill()
t.done()
Above is the code for drawing a triangle, Now to run this program you need to have python installed on your computer, If you don’t have then follow this guide: Install and setup python on your computer or use this online python compiler .
When will run the program and it will open a new window and it will start drawing a triangle and below is the finished drawing of a triangle.
As you can see, we successfully drew a red triangle, I hope you found this tutorial helpful and useful, do share it with your friends who might be intrested.
Here are some more python drawing tutorials for you:
- Draw Pikachu using python with code.
- Draw doraemon using python turtle.
- Draw shinchan using python turtle.
- Draw I love you using python turtle.
- Draw Batman logo using python turtle.
- Draw Google Logo using python turtle.
- Make a python calculator using turtle.
- Draw christmas tree using python.
- Draw spiderman in python programming.
- Draw Python Logo Using Python.
- Draw Iron Man using python turtle with code.
- Draw A Heart Using python turtle with code.
- Draw car in python turtle with code.
- Draw a Cat In Python Turtle With Code.
- Draw Panda In Python Turtle With Code.
- Draw Smiley Face In Python With Code.
I hope you found what you were looking for from this tutorial, and if you want more python guides and tutorials like this, do join our Telegram channel for future updates.
Thanks for reading, have a nice day 🙂