At Friday 6/10/2006 20:57, erikcw wrote:

I ended up using len(sys.argv) > 1 for this particular problem.  But I
think slicing is closer to the tool I was looking for.

I found a.has_key(k) or "k in a" for dictionaries - but haven't found
anything similar for lists.  Does it exist?

if 2 in [1,2,3]: print "Use the same (in) operator"
elif 'E' in ('E','r','i','k'): print "Works for any sequence"
elif 'o' in 'hello': print "Even strings"



Gabriel Genellina
Softlab SRL

        
        
                
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! http://www.yahoo.com.ar/respuestas

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to