摘要:
```python from threading import Thread from multiprocessing import Process import time 计算密集型 def work1(): res=0 for i in range(100000000): #1+8个0 res*=i if __name__ == '__main__': t_list = [] start = 阅读全文
摘要:
```python #方式一: x=0 def task(): count=0 while True: global x x=x + 1 print(x) count=count + 1 if count == 100: break task() #打印结果就是:1-100 #方式二 x=0 count=0 def task(): global x,count x = x + 1 print(x) 阅读全文