Light Mode
Dark Mode
importing modules

Hello,

As far as I'm concerned this is a valid code altough I cannot import modules into functions:

from decimal import *
getcontext().prec=3
def checkio(*args):

    if args:
        result = Decimal(max(*args)) - Decimal(min(*args))
    else:
        return 0

    return result

Also tried with round() but it's just less effective. Please let me know if you consider this valid or should I find another solution.

Created: Jan. 20, 2020, 11:21 p.m.
Updated: Jan. 21, 2020, 11:33 p.m.
0
7
User avatar
Spintec