[python-advocacy] How programming language webpages should be designed
Ray Allen
rayallen153 at googlemail.com
Thu Nov 12 18:38:26 CET 2009
Thanks for the advice on the list indentation, comments and avoiding 'each'
as a variable - changes applied. I think it's right to keep iteration as
simple as possible, but I also think it's worth keeping an explicit count.
This provides the opportunity to demo the ease with which an integer
variable can be set. That leaves me with:
"""Example Python Program"""
import random
python = ["Easy to read",
"Fast to code",
"Quick to learn",
"Modular and object oriented"]
python.append("Open source and cross platform")
random.shuffle(python)
count = 1
print "Python is ... "
for feature in python:
print count,feature
count += 1
print "Discover more at http://www.python.org"
Not sure about the pythagorean triples as a means of demonstrating python
code. I was aiming for something that demonstrated to the uninitiated just
how close to psuedocode Python could look.
Ray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/advocacy/attachments/20091112/ebebf87e/attachment.htm>
More information about the Advocacy
mailing list