Steve Howell schrieb:
> --- "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
> 
>> Is there a resource somewhere on the net that can be
>> used to quickly
>> and effectively show Python's strengths to
>> non-Python programmers?
>> Small examples that will make them go "Wow, that
>> _is_ neat"?
>>
> 
> 15 small programs here:
> 
> http://wiki.python.org/moin/SimplePrograms
> 

IMHO a few python goodies are missing there.
e.g. generator functions:

# generic fibonacci without upper bound:
def fib():
    parent_rabbits, baby_rabbits = 1, 1
    while True:
        yield baby_rabbits
        parent_rabbits, baby_rabbits = baby_rabbits, parent_rabbits + 
baby_rabbits


# only calculate and print the first 100 fibonacci numbers:
from itertools import islice

for baby_rabbits in islice(fib(),100):
    print 'This generation has %d rabbits' % baby_rabbits
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to