my code (shown below) is producing a result that was not as expected and I don't understand why
InningsPitched = [228,205,196,194,181,164]
EarnedRuns = [58,74,49,67,59,79]
Pitcher = ["Sandy Alcantara","Aaron Nola","Alek Manoah","Yu Darvish","Joe Musgrove","Corey Kluber"]
i = 0
for era in InningsPitched:
print(Pitcher[i],9 * EarnedRuns[i] // InningsPitched[i] + 9 * EarnedRuns[i] % InningsPitched[i] / InningsPitched[i] * 100 // 1 / 100)
i=i+1
Sandy Alcantara 2.2800000000000002
Aaron Nola 3.24
Alek Manoah 2.25
Yu Darvish 3.1
Joe Musgrove 2.93
Corey Kluber 4.33
I was expecting Sandy Alcantara to have an ERA of 2.28 not 2.2800000000000002