Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 391 Bytes

calculator.md

File metadata and controls

23 lines (18 loc) · 391 Bytes

Calculator - Unit Tests

Write unit tests for the following functions

def add(x, y):
   """Add numbers"""
   return x + y

def substract(x, y):
   """Substract numbers"""
   return x - y

def multiply(x, y):
   """Multiply numbers"""
   return x * y

def divide(x, y):
   """Divide numbers"""
   if y == 0:
       raise ValueError('Can not divide by zero!')
   return x / y