Moving from PHP to Python. Is it Possible

zeph zephjc at gmail.com
Fri Dec 11 15:20:51 EST 2009


On Dec 11, 8:58 am, MRAB <pyt... at mrabarnett.plus.com> wrote:
> output = ['<html><head>']
> output.append('<title>My Page</title>')
> output.append('</head><body>')
> output.append('<h1>Powers of two</h1>\n<ol>')
> for n in range(1, 11):
>      output.append('<li>%s</li>' % (2 ** n))
>
> output.append('</ol></body></html>')
> print ''.join(output)

Agreed (I might join on '\n' though), I was just trying to introduce
as few new concepts as possible :)



More information about the Python-list mailing list