Question: test: ROUND = [('round', (0.22), 0), ('round', (-0.22), 0), ('round', (0.5), 0), ('round', (5.844, 1), 5.8), ('round', (5.848, 2), 5.85), ('round', (3.55, 1), 3.6),
test:
ROUND = \
[('round', (0.22), 0),
('round', (-0.22), 0),
('round', (0.5), 0),
('round', (5.844, 1), 5.8),
('round', (5.848, 2), 5.85),
('round', (3.55, 1), 3.6),
('round', (3.45, 1), 3.4)]

round() Write a function round (number [, ndigits]) that models the behavior of the built-in function. Input: a float number, and an optional argument, a non-negative integer ndigits. The default parameter value for ndigits is 0. Output: if ndigits is 0, an integer, else a float, rounded to ndigits after the decimal point. If the first dropped digit is greater than 5, round up; if the first dropped digit is less than 5, round down; else round in such a way that the remaining digit in the smallest position is even
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
