Tell us what’s happening:
I have created this solution for this problem. But the rounding error doesn’t allow me to get all 5 because in test 3 the answer required is 8.3 and the average is 8.2 rounded.
My idea
def calculate_handicap(scores, pars):
return round((sum(scores) - sum(pars)) / len(pars), 1)
Your code so far
def calculate_handicap(scores, pars):
return round((sum(scores) - sum(pars)) / len(pars),1)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
Challenge Information:
Daily Coding Challenge - Golf Handicap Calculator
https://www.freecodecamp.org/learn/daily-coding-challenge/08-04
GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/daily-coding-challenges-python/6a26df3e2988bcdded204895.md at main · freeCodeCamp/freeCodeCamp · GitHub