On Aug 20, 10:35 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote:
> #!/usr/bin/env python
<snip>
> if __name__ == "__main__":
>
>     print "The return for 'fred' : %s" % returnCode('fred')
>     print "The return for 'silk' : %s" % returnCode('silk')
>     print "The return for 'silky' : %s" % returnCode('silky')
>     print "The return for 'hand' : %s" % returnCode('hand')
>     print "The return for 'strand' : %s" % returnCode('strand')
>     print "The return for 'bank' : %s" % returnCode('bank')
>

Shawn -

All that copy/pasting has got to have carpal tunnel written all over
it - DRY!

tests = "fred silk silky hand strand bank".split()
for test in tests:
    print "The return for '%s' : %s" % (test, returnCode(test))

-- Paul

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to