Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion ten small Python programs
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Steve Howell  
View profile  
 More options May 28 2007, 1:23 am
Newsgroups: comp.lang.python
From: Steve Howell <showel...@yahoo.com>
Date: Sun, 27 May 2007 08:23:26 -0700 (PDT)
Local: Mon, May 28 2007 1:23 am
Subject: Re: ten small Python programs

--- BartlebyScrivener <bscrivene...@gmail.com> wrote:
> On May 26, 1:43 pm, Steve Howell
> <showel...@yahoo.com> wrote:
> >     ------
> >     # def defines a method in Python
> >     def tax(itemCharge, taxRate = 0.05):
> >         return itemCharge * taxRate
> >     print '%.2f' % tax(11.35)
> >     print '%.2f' % tax(40.00, 0.08)

I decided to go with a simpler example up front.

    ------
    # def defines a method in Python
    def say_hello(name):
        print 'hello', name
    say_hello('Jack')
    say_hello('Jill')

More here:

http://wiki.python.org/moin/SimplePrograms

Somebody also fixed a few style things in my other
examples, changing a tuple to a list, catching a more
specific exception.  Whoever you are, thanks, I agree.

___________________________________________________________________________ _________Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google