Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add(a : float, b : float) ->float:
- '''Function adds two numbers and returns the sum as a float.'''
- return float(a + b)
- def sub(a : float, b : float) ->float:
- '''Function subtracts b from and returns the difference as a float.'''
- return float(a - b)
- def mult(a : float, b : float) ->float:
- '''Function multiplies two numbers and returns the product as a float.'''
- return float(a * b)
- def div(a : float, b : float) ->float:
- '''Function divides two numbers and returns the quotient as a float.
- It will also check if the divisor is 0 and flag an error and return a
- large negative float if this is true.'''
- try:
- return a / b
- except ZeroDivisionError:
- print("Unable to Divide By Zero")
- return -9999999999999.9
- def mod(a : float, b : float) ->float:
- return float(a % b)
- def exp(a : float, b : float) ->float:
- return float(a ** b)
Advertisement
Add Comment
Please, Sign In to add comment