Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 375 Bytes

calculator.md

File metadata and controls

22 lines (17 loc) · 375 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"""

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