Last active
October 11, 2021 01:24
-
-
Save ycui1/e776f0d467b6b337c5ac992270a0b832 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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