I'm new to programming and I'm having trouble with a school assignment. I need to print the heart from 'Automate the Boring Stuff Chapter 4', (I already did that.) So now I need to rotate it -90°, I tried multiple solutions, (like reversing the range) but nothing works. What im trying to print is this:
....O....
...OOO...
..OOOOO..
.OOOOOOO.
.OOOOOOO.
..OO.OO..
Here is my code (Spoilers ahead):
grid = [['.', '.', '.', '.', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
['O', 'O', 'O', 'O', '.', '.'],
['O', 'O', 'O', 'O', 'O', '.'],
['.', 'O', 'O', 'O', 'O', 'O'],
['O', 'O', 'O', 'O', 'O', '.'],
['O', 'O', 'O', 'O', '.', '.'],
['.', 'O', 'O', '.', '.', '.'],
['.', '.', '.', '.', '.', '.']]
for i in range(6):
for a in range(9):
if a < 8:
print(grid[a][i], end="")
else:
print(grid[a][i])
I would like to thank y'all in advance.
numpy?