[Tutor] Quick Question on String Compare
Sarma Tangirala
tvssarma.omega9 at gmail.com
Sat Jun 1 07:47:42 CEST 2013
Hi,
I had a quick question on how string compare works. If did '1001' <= '999'
I get true. I know how the string compare works but I was wondering why it
were so. Why doesn't the string length factor into the comparison? For
example, If I compared character-by-character but also found how different
the lengths are, I could avoid a wrong logical answer as in the example
above. Any thoughts?
Thanks
--
0 1 0
0 0 1
1 1 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130601/adbcdaee/attachment-0001.html>
More information about the Tutor
mailing list