Last active
January 31, 2022 23:05
-
-
Save ycui1/ce9ec73e0d93a0007873965e5c32ffc3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 quotient(dividend, divisor, taking_int=False): | |
""" | |
Calculate the product of two numbers with a base factor. | |
:param dividend: int | float, the dividend in the division | |
:param divisor: int | float, the divisor in the division | |
:param taking_int: bool, whether only taking the integer part of the quotient; | |
default: False, which calculates the precise quotient of the two numbers | |
:return: float | int, the quotient of the dividend and divisor | |
""" | |
result = dividend / divisor | |
if taking_int: | |
result = int(result) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment