Python Assignment

1. What are library modules? Provide an example of how might you use a module as a programmer?

1. What is List Comprehension? How might this functionality be useful for programmers? List and describe the four criteria that should be met when using top-down design. What are some of the benefits of using this model?

2. Complete # 26 on Page 176 and #32 on Page 177.

In Exercises, determine the value of list2, where list1 = [“democratic”, “sequoia”, “equals”, “brrr”, “break”, “two”].

26. list2 = [word.capitalize() for word in list1]

In Exercises 32 use list comprehension to simplify the code.

numbers = [9, -5, 4, 1, -7] newList = [] for num in numbers: if num >= 0: newList.append(num ** .5) #square root print(newList)

Schneider, David I.. Introduction to Programming Using Python, An (Page 177). Pearson Education. Kindle Edition.

3. create a program see the attachment. The program must include 15 to 40 instructions (excluding comments) that include sequential, conditional and/or iterative programming structures, and functions to convert input into required output

Then attached a word document explaining:

  1. Problem statement – Describe the problem in your own words.
  2. Problem Analysis – Use the input-process-outcome model described by Schneider.
  3. Logical Design – Use tools (pseudocode, flow charts, etc.) to map out processing in line with the problem analysis.
  4. Coding – Translate pseudocode in Python code. Make sure to include comments to explain what is happing.
  5. Correcting/debugging and Testing – Error log should include iterative updates/changes.
  6. Documentation (beyond comments in the code).
  7. Reflection – Lessons learned about programming in the course of doing the assignment.