• Got TypeError: 'set' object is not subscriptable

Question related to mission Pawn Brotherhood

 

My code seems like this:

def safe_pawns(pawns: set) -> int:
count = 0
var = ''
for paw in pawns:
    print(paw)
    var = ord(paw[0])-1
    paw1= chr(var)+str(int(paw[1])-1)
    var = ord(paw[0])+1
    paw2= chr(var)+str(int(paw[1])-1)
    for i in range(0, len(pawns)):
        if pawns[i] == paw1 or paw2:
            count+=1
    print(paw1,paw2)


return count

Can't get it, why error's here? Help me pls :)