import time import sys f1=open('c:\inputs\in5_5.txt','r') f2=open('out_25_sec5_5.txt','w') for row in f1: lt=row.split(",") w=int(lt[0]) w1=int(lt[1]) f1.closed j=time.clock() add=0 while w<=w1: x=w x1='' while x >0: x2=x % 16 if x2 == 10 : x1=x1+'A' elif x2 == 11 : x1= x1+'B' elif x2 == 12 : x1= x1+'C' elif x2 == 13 : x1=x1+'D' elif x2 == 14 : x1=x1+'E' elif x2 == 15 : x1=x1+'F' else : x1=x1+str(x2) x=x/16 x1=x1[::-1]+'\n' f2.write(x1) w=w+1 i=time.clock() f2.write( 'No. of Addition=1\n' ) f2.write('No. of Multiplication =1\n') f2.write('Time Used='+str(i-j)) mem=sys.getsizeof(w)+sys.getsizeof(w1)+sys.getsizeof(x)+sys.getsizeof(x1)+sys.getsizeof(x2) f2.write('\nMemory Used='+str(mem)) f2.close()