Python杂记
SmileTAT
这个作者很懒,什么都没留下…
展开
-
Python 默认递归深度
递归栈溢出Python3.7.3 中默认递归深度为1000,若超过此递归深度将抛出异常 "RecursionError: maximum recursion depth exceeded while calling a Python object".解决方案import sysprint(sys.getrecursionlimit()) # 1000sys.setrecursionlim...原创 2019-08-31 19:50:19 · 530 阅读 · 0 评论 -
Python 整除
Version:Python 3.7.3Python3中除法 ‘/’ 表示浮点运算,例如,3/2=1.5,-3/2=-1.5。除法 ‘//’ 表示整除,例如,3//2=1,-3//2=-2。其中特殊之处为C/C++中 -3/2(整除)等于-1。Python 文档解释引用地址:https://docs.python.org/3.7/glossary.html#term-abstract-...原创 2019-08-31 20:05:13 · 26579 阅读 · 4 评论