Дарья Дроздова, 522 группа FixFloat 12851
Миронов Денис, 519/2 группа FixFloat 12632
f1def fix(n):f1def fix(n):
22
n3    def decorator(fun):n3    def decorator(func):
44
n5        def newfun(*args, **kwargs):n5        def _decoracor(*args, **kwargs):
6            newargs = []6            new_args = []
7            for item in args:7            for arg in args:
8                if type(item) == float:8                if type(arg) == float:
9                    newargs.append(round(item, n))9                    new_args.append(round(arg, n))
10                else:10                else:
n11                    newargs.append(item)n11                    new_args.append(arg)
12            newkwargs = {}12            new_kwargs = {}
13            for (keyitem) in kwargs.items():13            for (k, v) in kwargs.items():
14                if type(item) == float:14                if type(v) == float:
15                    newkwargs[key] = round(item, n)15                    new_kwargs[k] = round(v, n)
16                else:16                else:
n17                    newkwargs[key] = itemn17                    new_kwargs[k] = v
18            result = fun(*newargs, **newkwargs)18            res = func(*tuple(new_args), **new_kwargs)
19            if type(result) == float:19            if type(res) == float:
20                return round(result, n)20                return round(res, n)
21            else:21            else:
t22                return resultt22                return res
23        return newfun23        return _decoracor
24    return decorator24    return decorator
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op