import csv f = open('Desktop.txt','r') f2 = open('Laptop.txt','r') f3 = open('UserList.csv','r') num = 0 num2 = 0 num3 = 0 for line in f.readlines()[1:]: print(line) num=num+1 for line2 in f2.readlines()[1:]: print(line2) num2=num2+1 UserLis = [] rd = csv.reader(f3) for line3 in rd: if UserLis!=0: UserLis.append(line3) for n in UserLis[1:]:num3=num3+1 print("Desktop:%s Laptop:%s Total:%s User Total:%s" %(num,num2,(num+num2),num3))