How could I change string in a 2d list?(python) : In python..
How could I change a string in a 2d list to 'X'?

this is the sample code.

I want to change '9' to 'X'
example : cavityMap(['1112', '1912', '1892', '1234'])
result : 1112, 1X12, 18X2, 1234

this is my incomplete code.


def cavityMap(grid):
    t = '9'

    for i, j in enumerate(grid):
        if i == 0:
            continue
        if i == len(grid)-1:
            break
        j = list(j)
        for a, b in enumerate(j):
            if b == t:
                pass
                
    return grid