I want to draw the shape of a triangle using python. I have already drawn the shape of circle but I cannot draw the triangle. Could someone please help me with this?
This is my code for the circle and I want to use the same type of code for the triangle.
import graphics
import random
win=graphics.GraphWin("Exercise 7",500,500)
win.setBackground("white")
for i in range(1000):x=random.randint(0,500)y=random.randint(0,500)z=random.randint(1,100)point = graphics.Point(x,y)circle=graphics.Circle(point,z)colour=graphics.color_rgb(random.randint(0,255),random.randint(0,255),random.randint(0,255))circle.setFill(colour)circle.draw(win)
win.getMouse()
win.close()
Thanks!