Simple fractal generation in Python