Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (30 sloc) 1.02 KB
"""
Example Operators
"""
def add_numbers(num1, num2):
"""Returns the addition of two integers."""
return num1 + num2
def subtract_numbers(num1, num2):
"""Returns the subtraction of two integers."""
return num1 - num2
def multiply_numbers(num1, num2):
"""Returns the multiplication of two integers."""
return num1 * num2
def divide_with_slash(num1, num2):
"""Returns the division of two integers."""
return num1 / num2
def modulo_division(num1, num2):
"""Returns the remainder after division of two integers."""
return num1 % num2
def is_a_greater_than_b(num1, num2):
"""Predicate function evaluating whether num1 is greater than num2."""
return num1 > num2
def is_a_equal_to_b(num1, num2):
"""Predicate function evaluating whether num1 is equal to num2."""
return num1 == num2
def as_a_float(num1):
"""Returns the float value of a number passed in."""
return float(num1)
def as_an_int(num1):
"""Returns the integer value of a number passed in."""
return int(num1)