I miss being able to do something like this in Python

1f (I = a.find("3")) != -1:
    print "It's here: ", I
else:
    print "No 3's here"

where I gets assigned the index returned by find() AND the if statement gets 
to do its job in the same line.  Then you don't have to have another like 
that specifically gets the index of the "3".  Is there a way to do this in 
Python?

Thanks!

Bob


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

Reply via email to