I have the following piece of code a = len(ab_file) b= 0 while(b<a): c= 0 d = len(cd_files) while(c<d): if cd_files[c] == ab_file[b]: files.append(ab_file[b].upper()) else: files.append(ab_file[b]) c = c + 1
b = b +1 print files I'm trying to compare the list with another list and if it is there in both I'm changing it to upper case and adding to another list and if its not there in both I just want to add it to the global list (ie files). I'm able to do the first part but when I'm doing the second part the files which are not there in both are getting repeatedly into the global file. Some one help me so that If ab = [a,b,c,d] and cd = [a,c] my global list file should be [A,b,C,d] -- http://mail.python.org/mailman/listinfo/python-list