Last active
April 4, 2019 07:38
-
-
Save osbre/2d70eea072a4dcda1c030efcbf0702b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows = [ | |
['x', 'x', 'x', 'x', 'x'], | |
['x', 'x'], | |
['x'], | |
] | |
for rowIndex, row in enumerate(rows): | |
nextRowIndex = rowIndex+1 | |
if(nextRowIndex < len(rows)): | |
nextRow = rows[nextRowIndex] | |
else: | |
nextRow = None | |
for positionIndex, position in enumerate(row): | |
# якщо наступний рядок існує | |
if nextRow is not None: | |
# перевірити чи є така ж позиція | |
if(positionIndex+1 <= len(nextRow)): | |
rows[rowIndex][positionIndex] = "f" | |
rows[nextRowIndex][positionIndex] = "F" | |
# print rows | |
for row in rows: | |
print(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment