I'm actually trying to understand if I'm following the right path in a calculation.
So there's a team, say Resen FC, with results in a season of 34 weeks as follows;
"3,1,1,1,0,0,3,1,1,3,3,0,0,1,3,1,3,3,1,1,0,0,0,0,3,1,1,1,0,3,3,0,1,1"
These numbers aren't necessarily specified as points received by the team but as representations of;
wins=3, draws=1, and losses=0
If each win was worth 3 points, each draw is 1, and a loss gets nothing, my calculation of this team's overall season record, as of the end of week 34 would be;
results = [3,1,1,1,0,0,3,1,1,3,3,0,0,1,3,1,3,3,1,1,0,0,0,0,3,1,1,1,0,3,3,0,1,1]
print(sum(results))
which gives the output of 44 points.
The team was supposed to be relegated had it got less than 40 points at the end of 34 weeks.
So I have couple of questions at this point:
Is there an alternative way for calculating the results without having to hand-write them in a list as I did above?
(might be tied to the first question) What if the representation of wins, draws and losses remained the same, but the points received for each result had been different?
Example:
"3,1,1,1,0,0,3,1,1,3,3,0,0,1,3,1,3,3,1,1,0,0,0,0,3,1,1,1,0,3,3,0,1,1"
Each win (3) is worth 5 points,
Each draw(1) is worth 2 points,
Each loss(0) is worth 1 point.
How could I have been able to calculate the team's end-of-season record? Could I have used a function which receives the results as input and do the job for any input matching the format?
Note: This is my first question ever. So I'd be appreciated if you could just consider that before canceling me out :)
Thanks y'all.
question from:
https://stackoverflow.com/questions/65893748/how-to-calculate-a-football-teams-total-points-received-in-a-given-season