def triangle(a, b, c): arr = [a,b,c] a, b, c = arr.sort() if a < 0 or a+b < c: raise Exception return ['equilateral','isosceles','scalene'][set(arr).size-1]