Checkerboard

easynumpy_manipulation

Implement checkerboard(n).

Return an (n, n) integer array filled with a 0/1 checkerboard pattern where the top-left cell [0, 0] is 0 (so cell [i, j] is (i + j) % 2). Use slicing — no for/while loops.

Constraints
  • no scipy, sklearn
  • no for/while loops

Your solution

Edit checkerboard and run the real pytest suite in your browser — no install required. Your code is saved locally.

⌘/Ctrl + ↵

Loading the Python runtime (first run only)…

Hints

Hint 1

Start from zeros and set alternating slices to 1: Z[1::2, ::2] and Z[::2, 1::2].