def number_of_dogs(pets): total = 0 for i in range(len(pets)): if pets[i].lower() == "dog": total += i return total