How to draw right angled triangle with python
<pre><code>def drawTri(a):
    b = (a*math.tan(45))
    c = (a/math.cos(45))

    t.forward(a)
    t.left(135)
    t.forward(c)
    t.left(135)
    t.forward(b)
</code></pre>

<p><img src="http://i.stack.imgur.com/anF4W.png" alt="enter image description here"></p>

<p>Who needs angles?</p>

<pre><code>def drawTri(a):
    x, y = turtle.position()
    turtle.goto(x + a, 0)
    turtle.goto(0, y + a)
    turtle.goto(x, y)
</code></pre>

python turtle-graphics