Picture of problem and code
For this problem, we’ll round an int value up to the next multiple of 10 if its rightmost digit is 5 or more, so 15 rounds up to 20. Alternately, round down to the previous multiple of 10 if its rightmost digit is less than 5, so 12 rounds down to 10. Given 3 ints, a b c, return the sum of their rounded values. To avoid code repetition, write a separate helper “def round10(num):” and call it 3 times. Write the helper entirely below and at the same indent level as round_sum().
**Why is this code not working? Also, is there a more efficient or better approach to the problem? ty.
**
It is written in the picture.
Karandeep is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1