Exerpad
Exercise 4 · Chapter: Pixel ProjectsOptional+50 XP

Gradient

Create a 10x10 grid that shows a gradient from black to blue!

Each row should use the same color. Row 0 is darkest (black), row 9 is brightest (blue).

Use hex colors! The format is "#0000XX" where XX is the blue intensity.

For row i, compute the blue value as i * 28 and use f"#0000{blue:02x}" to format it as hex.

Don't change the print statements at the bottom.

Expected output
10
#000000
#0000fc
Need a hint?
3 available · costs 5 XP each
python
grid = []
# Create a 10x10 gradient from black to blue
# Row i: blue value = i * 28
# Color format: f"#0000{blue:02x}"


__grid__ = grid

# Don't change below this line
print(len(grid))
print(grid[0][0])
print(grid[9][0])
Output
Run your code to see the output here.