Homework Assignment Number 3

  1. Read Chapter 3
  2. Create a .py file that includes all written homework. It should be possible to load the python file using idle and run it. It should not crash just by running it. You should test this before submitting the file.
  3. Write a mathematically oriented function of your choice that calculates something relevant to math or science. Define a global variable and set it to the output of  call to this function.
    Example: temp_today = faren_to_celcius(35)
  4. Write a function that:
    1. Takes one or more strings as arguments
    2. Alters the strings by using the concatenation operator '+' in some way.
    3. Prints helpful messages and returns the altered string
Example:  month_day_year('January',31,2011)
Causes the following 3 lines of print:
Month = January
Day = 31
Year = 2011
Then it returns the string 'January 31, 2011
  1. Do the following in IDLE and write a comment at the bottom of your .py file explaining the result:
output = 1
for number in range(1,5):
output = output*number
How the Homework will be graded
  1. Does the code run?
  2. Does it fulfill the assignment, anwer the question asked, etc.?
  3. Is it clear?
  4. When given latitude, do you choose a really easy example, a medium example, a creative or interesting example, etc.?  I.e., Bells and whistles are never required, but they may help your grade.