Last active
October 10, 2022 15:09
-
-
Save RaMSFT/cfe78881c1e745deacd6f8909dcbcad9 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 calculate_points(wins, draws, losses): | |
| """calculate points for a football match based on wins, losses, and draws | |
| Args: | |
| wins (integer): number of wins | |
| draws (integer): number of draws | |
| losses (integer): number of losses | |
| Returns: | |
| _type_: _description_ | |
| """ | |
| # number of points for wins: 3 | |
| # number of points for drwas: 1 | |
| # number of points for losses: 0 | |
| points = (3 * wins) + (1 * draws) + (0 * losses) | |
| # don't necessarily need to put the last bit (0 * losses), it always results in 0 | |
| return points | |
| print(calculate_points(3, 4, 2)) | |
| print(calculate_points(5, 0, 2)) | |
| print(calculate_points(0, 0, 1)) | |
| print(calculate_points(3, 9, 8)) | |
| print(calculate_points(1, 3, 2)) | |
| print(calculate_points(6, 9, 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment