Hi All,

This is my first mail to python-list.

I just want to propose the idea of introducing a new method for the List Object 
in similar lines of Dictionary Object has_key method.

See my below code, It always produces the ValueError, if I want to check 
whether an item is present or not, then they is no method in the List Object 
(do a "dir(list)").

So., Is it not good, to have a method in List Object, may be something like 
has_item to check whether a item is present or not?

#============== CODE ==============================
partsOfMyName = ['Python', 'Perl', 'PHP', 'MySQL'];
## strSearchKey = 'Perl';
strSearchKey = 'Prl';

indexofKey = partsOfMyName.index(strSearchKey);
print 'Index of search key: %s:  %d'%(strSearchKey, indexofKey);

Thanks
Venkata Rama Krishna Boddu


      Explore and discover exciting holidays and getaways with Yahoo! India 
Travel http://in.travel.yahoo.com/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to