Count league points
A sports league awards 3 points for a win and 1 for a draw. Total the points earned.
- A win is worth 3 points.
- A draw is worth 1 point.
- Losses earn nothing.
league_points(wins: int, draws: int) → int
Where you start
def league_points(wins: int, draws: int) -> int:
Worked examples
| Call | Result |
|---|---|
league_points(3, 1) | 10 |
league_points(0, 0) | 0 |
league_points(1, 1) | 4 |
league_points(5, 0) | 15 |
Hint
Multiply wins by three and add the draws.
Reference solution in Python
def league_points(wins: int, draws: int) -> int:
return 3 * wins + draws