Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def calculate_fraction(a, b):
"""
Calculate a fraction of two numbers
:param a: int or float, the numerator of the fraction
:param b: int or float, the denominator of the fraction
:return: float, calculated as a /b
:raise: ZeroDivisionError (when b is zero)
"""
return a / b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment