Discuss / Python / 作业

作业

Topic source

好学者

#1 Created at ... [Delete] [Delete and Lock User]
import time, functoolsdef log(time):   @functools.wraps(time)   def metric(*args, **kw):       print('%s executed in %s ms' % (time.__name__, 10.24))       return time(*args, **kw)   return metric@logdef fast(x, y):    time.sleep(0.0012)    return x + y;@logdef slow(x, y, z):    time.sleep(0.1234)    return x * y * z;f = fast(11, 22)s = slow(11, 22, 33)if f != 33:    print('测试失败!')elif s != 7986:    print('测试失败!')

  • 1

Reply