def triangle(a, b, c):
    if (a <= 0 or b <= 0 and c <= 0):
        raise TriangleError()
    
    if (a == b and b == c and c == a):
        return 'equilateral'
    elif (a == b or b == c or c == a):
        return 'isosceles'
    elif (a != b and b != c and c != a):
        return 'scalene'

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

def triangle(a, b, c):
    if (a <= 0 or b <= 0 and c <= 0):
        raise TriangleError()
    
    if (a == b and b == c):
        return 'equilateral'
    elif (a == b or b == c or c == a):
        return 'isosceles'
    else:
        return 'scalene'

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

Simplify logic conditionals as tests still pass.
Simplify logic conditionals as tests still pass.

  def triangle(a, b, c):
      if (a <= 0 or b <= 0 and c <= 0):
          raise TriangleError()
      
-     if (a == b and b == c and c == a):
+     if (a == b and b == c):
          return 'equilateral'
      elif (a == b or b == c or c == a):
          return 'isosceles'
-     elif (a != b and b != c and c != a):
+     else:
          return 'scalene'
  
  # Error class used in part 2.  No need to change this code.
  class TriangleError(Exception):
      pass
  
Simplify logic conditionals as tests still pass.
## Code Before:
def triangle(a, b, c):
    if (a <= 0 or b <= 0 and c <= 0):
        raise TriangleError()
    
    if (a == b and b == c and c == a):
        return 'equilateral'
    elif (a == b or b == c or c == a):
        return 'isosceles'
    elif (a != b and b != c and c != a):
        return 'scalene'

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

## Instruction:
Simplify logic conditionals as tests still pass.
## Code After:
def triangle(a, b, c):
    if (a <= 0 or b <= 0 and c <= 0):
        raise TriangleError()
    
    if (a == b and b == c):
        return 'equilateral'
    elif (a == b or b == c or c == a):
        return 'isosceles'
    else:
        return 'scalene'

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