def fun (a,b): try: c = a/b except Exception as ex: logging.error(ex) return c
请高手回答向这种函数的返回是不是一种不正规的编程方式,因为这个函数可能返回为“None”,那么例如这种情况的时候如何更好的定义这个函数?
相关分类