I am learning Python by doing Python Koans these days, and I came up with the problem of raising exceptions in Python. Specifically, I am even confused with `try...except...` after going through the koan. I know there is a similar question toward Rudy Koan [Ruby Koan 151 raising exceptions](https://stackoverflow.com/questions/3834203/ruby-koan-151-raising-exceptions). But I am a Python newbie and know nothing about Ruby.

So here is the koan:

```
# You need to finish implementing triangle() in the file 'triangle.py'
from triangle import *

class AboutTriangleProject2(Koan):
    # The first assignment did not talk about how to handle errors.
    # Let's handle that part now.
    def test_illegal_triangles_throw_exceptions(self):
        # Calls triangle(0, 0, 0)
        self.assertRaises(TriangleError, triangle, 0, 0, 0)

        self.assertRaises(TriangleError, triangle, 3, 4, -5)
        self.assertRaises(TriangleError, triangle, 1, 1, 3)
        self.assertRaises(TriangleError, triangle, 2, 4, 2) 

```

the following is triangle.py

```
def triangle(a, b, c):
    # DELETE 'PASS' AND WRITE THIS CODE

    if a == b and b == c and c == a:
        return 'equilateral'
    if a == b or b == c or a == c:
        return 'isosceles'
    else:
        return 'scalene'

# Error class used in part 2.  No need to change this code.
class TriangleError(StandardError):
    pass

```

I am supposed to finish `triangle()` function. 

To my understanding, the `try...except...` functions like if certain criteria satisfied then do something, else through out an exception. Then in my situation, should I use `if ... then raise TriangleError` or `try... except ...`? What are the differences between them?

Thank you very much!