-6
Code:Python 3 Liste in einem langen Strang
grid = [['.','.','0','0','.','0','0','.','.'],
['.','0','0','0','0','0','0','0','.'],
['.','0','0','0','0','0','0','0','.'],
['.','.','0','0','0','0','0','.','.'],
['.','.','.','0','0','0','.','.','.'],
['.','.','.','.','0','.','.','.','.'],
['.','.','.','.','.','.','.','.','.']]
print(grid)
Ergebnis:
[['.', '.', '0', '0', '.', '0', '0', '.', '.'], ['.', '0', '0', '0', '0', '0', '0', '0', '.'], ['.', '0', '0', '0', '0', '0', '0', '0', '.'], ['.', '.', '0', '0', '0', '0', '0', '.', '.'], ['.', '.', '.', '0', '0', '0', '.', '.', '.'], ['.', '.', '.', '.', '0', '.', '.', '.', '.'], ['.', '.', '.', '.', '.', '.', '.', '.', '.']]
Erwartetes Ergebnis:
[['.','.','0','0','.','0','0','.','.'],
['.','0','0','0','0','0','0','0','.'],
['.','0','0','0','0','0','0','0','.'],
['.','.','0','0','0','0','0','.','.'],
['.','.','.','0','0','0','.','.','.'],
['.','.','.','.','0','.','.','.','.'],
['.','.','.','.','.','.','.','.','.']]
Wovon redest du? Woher kam die plötzliche Feindseligkeit? –