Roy Smith <r...@panix.com> wrote: > In article <roy-aaaeea.10571424122...@news.panix.com>, > Roy Smith <r...@panix.com> wrote: > > > >>> len([x for x in zip(s1, s2) if x[0] != x[1]]) > > Heh, Ian Kelly's version: > > > sum(a == b for a, b in zip(str1, str2)) > > is cleaner than mine. Except that Ian's counts matches and the OP asked > for non-matches, but that's an exercise for the reader :-)
:-) I'm actually walking through a directory tree and checking that file characteristics don't change in a sequence of files. What I'm looking for is 'unusual' changes in file characteristics (they're image files with camera information and such in them) in a sequential list of files. Thus if file001, file002, file003, file004 have the same camera type I'm happy, but if file003 appears to have been taken with a different camera something is probably amiss. I realise there will be *two* character changes when going from file009 to file010 but I can cope with that. I can't just extract the sequence number because in some cases they have non-numeric names, etc. -- Chris Green -- http://mail.python.org/mailman/listinfo/python-list