#how many cubes you want to add on each axis
count = 100

for i in range (0,count):
for cube_instance in range(0,count):
x = 1
y = 1 + i
position = [x, y, 0]
H = 2
lacunarity = .5
octaves = 4
z = mathutils.noise.fractal(position, H, lacunarity, octaves, noise_basis=noise.types.STDPERLIN) #z = 0
bpy.ops.mesh.primitive_cube_add(location=(x * cube_instance + 1,y,z))

I’m getting an error message on the line defining z as Perlin Noise.