提交 ab93138a 编写于 作者: 盼小辉丶's avatar 盼小辉丶

上传新文件

上级 aae721a3
import logging, sys
logging.basicConfig(level=logging.INFO, stream=sys.stderr, format='%(asctime)s %(name)s %(levelname)s %(message)s')
log = logging.getLogger(__name__)
def my_add(a, b, weight=1):
log.info('Starting add')
if a == b == 0:
log.warning('Warning! 0 for any one')
res = (a + b) * weight
log.info('(%s + %s) * %s = %s' % (a, b, weight, res))
print(res)
if __name__ == '__main__':
my_add(5, 3)
my_add(0, 0)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册