Ex
Exerpad
🔥0
0 XP
Lv.1 Beginner

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.

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])
Exerpad — Learn to Code with Fun!