What I've got at the moment is a grid, which looks like this:
--d--
--d--
-d---
---d-
-d-d-
I'm trying to find the location of each 'd' within the grid. I am able to do this using a simple for loop, however I encounter a problem when I try to find the two 'd's on the same line, it only finds the first one and not the second one. However since it is in a list format (not 100% sure if I can change it out of that format) the .find() method will not work. Not sure if there's a simple way to solve this or if I need to completely re-think my approach but any help would be useful.
Code for the search that I've got at the moment(without the attempt to search for multiple occurrences as it broke everything)
Assume board is the grid mentioned earlier
dirtyCellLocations = []
for idx, row in enumerate(board):
for letter in row:
if letter == 'd':
dirtyLocation = (idx, row.index('d'))
dirtyCellLocations.append(dirtyLocation)
If you're interested the way the grid was formed is with this
board = [[j for j in raw_input().strip()] for i in range(5)]