keyword_args - # simple interest for a given principal,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# This program demonstrates keyword arguments. # def main(): # Show the amount of simple interest using 0.01 as # interest rate per period, 10 as the number of periods, # and $10,000 as the principal. show_interest(rate=0.01, periods=10, principal=10000.0) # The show_interest function displays the amount of
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # simple interest for a given principal, interest rate # per period, and number of periods. # def show_interest(principal, rate, periods): interest = principal * rate * periods print 'The simple interest will be $%.2f.' % interest # Call the main function. main()...
View Full Document

This note was uploaded on 07/15/2010 for the course CSE CSE1530 taught by Professor Lew during the Spring '09 term at York University.

Ask a homework question - tutors are online