第五次作业
#列表循环实数组相加 def Sum(n): a=list(range(n)) b=list(range(0,5*n,5)) c=[] for i in range(len(a)): c.append((c)) #print((Sum(10)) #用numpy实现实数组相加 import numpy def arySum(n): a=numpy.arange(n) b=numpy.arange(0,8*n,8) c=a+b return (c) print(arySum(10)) from datetime import datetime #效率 s_sum=datetime.now() Sum(100) delta_sum=datetime.now()-s_sum print(delta_sum) #效率 s_numpy=datetime.now() Sum(100) dalta_numpy=datetime.now()-s_numpy print(dalta_numpy)