Python Basics: How to add in a grid of cubes

Just getting into Blender Python, but I know how to code in Python. I want to get started by adding in a grid of 128x128 cubes flat as a base, and then hopefully work on applying a height map afterwards. I want there to be no gaps so that they fit right next to each other.

I should add that I’m working towards creating a Minecraft style game.

How is this done in Blender?

make a grid instead

use this code here

happy bl