String comparison problem

Piet van Oostrum piet at cs.uu.nl
Wed Apr 7 17:36:52 EDT 2004


>>>>> "Senthoorkumaran Punniamoorthy" <solution88pro at hotmail.com> (SP) wrote:

SP> I am printing these information.
SP> 	print string.lower(info_res[2])
SP> 	print string.lower(md5sum(f_md5))
SP> 	print len(string.lower(info_res[2]))
SP> 	print len(string.lower(md5sum(f_md5)))
SP> 	print str(string.lower(md5sum(f_md5)) == string.lower(info_res[2]))

SP> and the output are

SP> 01b7ebfc27437a90cc421c50df8f9ac5
SP> 01b7ebfc27437a90cc421c50df8f9ac5
SP> 32
SP> 32
SP> False

SP> I was wondering why the last print statement is returning false when two
SP> strings are identical?

They are not identical, because md5sum is reading from the file.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list