That's because elif is just an extension of the original if statement (it's short for "else if"). If the first if statement succeeds, successive elif statements are not executed. Use "if" in place of "elif".
Also, don't use find. Use in! The in operator returns true if an element is in a list.
if tool in bob:
owners.append('bob') You might also wish to use a dictionary to store all of the data, rather than several lists. A dictionary matches keys to values. Consider the following dictionary:
people = dict(
bob = ['hammer', 'saw'],
joe = ['saw', 'drill', 'leveler'],
bill = ['hammer', 'leveler']
) This associates a set of strings with a set of lists. You can also write the same dictionary out in an alternative format:
people = {
'bob' : ['hammer', 'saw'],
'joe' : ['saw', 'drill', 'leveler'],
'bill' : ['hammer', 'leveler']
} You can use a dictionary to pull out information about a single person:
print "Bob's tools:", people['bob']
Or iterate through all the people:
for person, tools in people.items():
print person, "has", tools
With a dictionary, finding out who owns what can be easily done with a list comprehension:
def whoowns(tool):
return [person for person, tools in people.items() if tool in tools]