from time import clock import sys f=open('in1_2.txt','r') f1=open('out_1_2.txt','w') start=clock() n=int(f.readline()) mul=0 fact=1 for i in range(1,n+1): fact=fact*i mul=mul+1 f1.write(str(i)+"="+str(fact)+'\n') elapsed=clock()-start total=sys.getsizeof(n)+sys.getsizeof(fact) f1.write("time elapsed is " +str(elapsed)+"\nmul "+str(mul)+"\nmemory "+str(total)) f.close() f1.close()