string compare question.Please Help!!!
张少驰
zhangsc at neusoft.com
Mon Dec 24 21:29:30 EST 2001
I have question about cmp function,follows:
$python
Python 2.2b1 (#1, Nov 21 2001, 10:24:36)
[GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>cmp('10.66.73.78','10.0.0.0')
1
#the result 1 is my desire
>>>cmp('10.66.73.78','10.255.255.255')
1
#the result isn't my desire,I want to
#make '10.66.73.78' is less than '10.255.255.255',
#I want to get 0,but it return 1
Where is my wrong? How to correct it? Thanks.
Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20011225/5c3d8504/attachment.html>
More information about the Python-list
mailing list