Created
August 6, 2024 15:42
-
-
Save AMMullan/b1fe5db50818f949aab08a259abf1fd4 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 percent_of(x: float, y: float) -> float: | |
return (x / 100) * y | |
def what_percent_of(x: float, y: float) -> float: | |
return (x / y) * 100 | |
def percent_change(x: float, y: float) -> float: | |
return ((y - x) / x) * 100 | |
x = 10 | |
y = 100 | |
print(percent_of(x, y)) | |
x = 166 | |
y = 1006 | |
print(what_percent_of(x, y)) | |
y = 90 | |
x = 100 | |
print(percent_change(x, y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment