Ex
Exerpad
🔥0
0 XP
Lv.1 Beginner

Pixel Art Heart

Create a heart shape using a 7x7 grid!

Use "red" for the heart and "white" for the background.

Here's what it should look like:

Hint: store the pattern as a list of strings, then loop through each character!

Don't change the print statements at the bottom.

python
pattern = [
"0100010",
"1110111",
"1111111",
"1111111",
"0111110",
"0011100",
"0001000",
]

grid = []
# Loop through the pattern
# '1' = "red", '0' = "white"


__grid__ = grid

# Don't change below this line
print(len(grid))
print(len(grid[0]))
print(grid[0][0])
print(grid[0][1])
print(grid[3][3])
Exerpad — Learn to Code with Fun!