Lapskaus IT
A computer blog as colorful as Lapskaus ingredients ...
Tuesday, October 19, 2010
How to find an element in a List and return the index, Python
Check if value exist in a list, L ?
if value in L:
print "list contains", value
Returns the index, where value exist in List, L :
i = L.index(value)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment