十四. Python基础(14)--递归 1 ● 递归(recursion) 概念: recursive functions-functions that call themselves either directly or indirectly in order to loop. 最大递归层数: the default maximum recursion depth in Python is 997. 限制条件: 一定有一个分支不调用自身 修改最大递归层数: import sys sys.se…
四. Python基础(4)--语法 1 ● 比较几种实现循环的代码 i = 1 sum = 0 while i <= 10: # 循环10-1+1=10次 sum += i i += 1 print(sum) sum = 0 for i in range(1, 11): # 循环11-1=10次 sum += i print(sum) i = 0 sum = 0 while True: i += 1 if i <=10: sum…