摘要: ```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 = 阅读全文
posted @ 2019-09-18 21:08 大海一个人听 阅读(641) 评论(0) 推荐(0) 编辑
摘要: ```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) 阅读全文
posted @ 2019-09-18 19:59 大海一个人听 阅读(1670) 评论(0) 推荐(0) 编辑