feat: 新增技能扩展 N3 一章相关示例源码

This commit is contained in:
100gle
2022-10-20 08:57:43 +08:00
parent 49e639445b
commit 226d721608
7 changed files with 1342 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from concurrent.futures import ProcessPoolExecutor
def fib(n):
if n <= 1:
return n
return fib(n - 1) + fib(n - 2)
def main():
n = [1, 3, 5, 10, 20]
with ProcessPoolExecutor(max_workers=4) as pool:
result = pool.map(fib, n)
print(list(result))
if __name__ == '__main__':
main()