Just indent four spaces at the left margin and you have a readable listing:
# Copyright (c) 2013, P. Lutus http://arachnoid.com # Released under the GPL http://www.gnu.org/licenses/gpl.html from numpy import arange # dimensional parameters for the set yl = -1.2 yh = 1.2 ys = .05 xl = -2.05 xh = 0.55 xs = 0.03 def mandelbrot(c): z = 0 for n in range(10): z = z*z + c if(abs(z) > 2): return '.' return '*' s = '' for y in arange(yl,yh,ys): for x in arange(xl,xh,xs): s += mandelbrot(complex(x,y)) s += '\n' print(s) Result: ....................................................................................... ....................................................................................... ..............................................................**....................... ...............................................................*....................... ................................................................*..**.................. ................................................................***.................... ...............................................................****.................... ...........................................................***********................. ............................................................**********................. ...........................................................***********................. ...................................................*.......***********..........*...... .................................................****..********************.....*...... ................................................***********************************.... .................................................********************************...... ...............................................**********************************...... .............................................************************************...... .............................................*************************************..... ..........................**......*.........*****************************************.. ............................***********.....***************************************.... ............................********************************************************... ..........................*********************************************************.... .....................*....*********************************************************.... ......................************************************************************..... .....................***********************************************************....... ..*****************************************************************************........ .....................***********************************************************....... ......................************************************************************..... .....................*....*********************************************************.... ..........................*********************************************************.... ............................********************************************************... ............................***********.....***************************************.... ..........................**......*.........*****************************************.. .............................................*************************************..... .............................................************************************...... ...............................................**********************************...... .................................................********************************...... ................................................***********************************.... .................................................****..********************.....*...... ...................................................*.......***********..........*...... ...........................................................***********................. ............................................................**********................. ...........................................................***********................. ...............................................................****.................... ................................................................***.................... ................................................................*..**.................. ...............................................................*....................... ..............................................................**....................... .......................................................................................