Skip to content

Instantly share code, notes, and snippets.

@ycui1
Last active October 11, 2021 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycui1/e776f0d467b6b337c5ac992270a0b832 to your computer and use it in GitHub Desktop.
Save ycui1/e776f0d467b6b337c5ac992270a0b832 to your computer and use it in GitHub Desktop.
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