I would like to give some feedback about ...
From: http://www.checkio.org/mission/pawn-brotherhood/solve/
With this code, I'm told that two arguments are needed, and only one is given. Though when I plug this into PyCharm, it runs successfully.
def indexing(pawns):
pawns_indexes = set()
safe_indexes = set()
for pawn in pawns:
row = int(pawn[1]) - 1
col = ord(pawn[0]) - 97
pawns_indexes.add((row, col))
safe_indexes.add((row + 1, col + 1))
safe_indexes.add((row + 1, col - 1))
safe_pawns(pawns_indexes, safe_indexes)
def safe_pawns(x, y):
safe = 0
for a in x:
if a in y:
safe += 1
print safe
HTTP_USER_AGENT:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36
Created at: 2015/11/09 02:48; Updated at: 2015/11/09 10:21