How to Draw a triangle shape in python? -
I want to draw a triangle using python. I've already drawn the shape of the circle but I can not drag the triangle. Can anyone 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. I
Import Graphics Random Win = Import Graphics. In the range I (1000): x = random.randint (0,500) y = random.randint (0,500) z = random.randint (1,100) point in graphin ("exercise 7", 500,500) win.setBackground ("white") = Graphics. Point (x, y) circle = graphics Circle (dot, jade) color = graphics color_rgb (random.randint (0,255), random.randint (0,255), random.randint (0,255) circle.setFill (color) circle.draw (win) win.getMouse () win.close () Thanks! <
This should be a triangle, with a random corner (corner):
I hope it helps.
Comments
Post a Comment