Question

Python set-up:

To write and run Python programs, you will need to download and install the Python

interpreter IDLE. It is available and free for Mac and for PC.

1. Download the latest version of Python here: https://www.python.org/downloads/

2. Install Python by double-clicking on the fille after downloading. You will always be using.

the IDLE environment that comes with Python, as is explained in the first unit.

Test Information

The at-home tests themselves generally take about two hours or less to complete (not including the

time you spend reading the unit PDF documents, watching tutorial videos, or practice programming).

• Each unit test always has an attached file that contains the test instructions in an

*.html document.

For example, the name of the test instructions file for the first at-home test (Unit 1 At-home

Test: testi py) is Unit instructions.html.

The test instructions explain in a step-by-step fashion how to write the final program that you will

submit.

You only need to submit your final program and not any code you may have written as part of one

of the preliminary steps.

. Carefully read the criteria in each task step, sentence-by-sentence.

This warning is critical in order to pass the at home tests./n• Some tests instructions show output where the program prompts the user repeatedly

for information. Please make sure that the program you submit also prompts the user

repeatedly, not just once.

Some unit tests ask for step-by-step implementation to enhance your program rather

than a list of tasks. This does not always mean writing the code of your program as

separate sections. Sometimes the tasks must be completed in sequential order and/or

the instructions might require you to alter your previous code written for a previous Task

step upon what is being asked in a latter Task step.

As you complete each at-home test, your program must satisfy the specified test constraints.

Do not use any Python features covered in later units (it is acceptable only if it is

explicitly mentioned)

• Do not use any Python features you may have read about online or in other

resources.

Please try not to make any lines in your program longer than 80 characters.

Test Constraints: Only use what you learned in Unit 1, Unit 2, Unit 3, Unit 4, Unit 5,

and Unit 6.

Reminder of implementation: The test instructions explain in a step-by-step fashion

how to write the final program that you will submit. Some steps are just preliminary

steps that will be enhanced and edited as you write the final version of your program

that you do plan to submit.

A reminder about input: the instructions for some of the at-home tests show output

where the program prompts the user repeatedly for information. Please make sure that

the program you submit also prompts the user repeatedly, not just once.

Notes:

IMPORTANT NOTICE: The weblink http://nancymcohen.com/esci133/cpiai.txt is no

longer functional. Instead, for step 1 of this unit test,

Use urllib.request to download CPI data

from https://futureboy.us/frinkdata/cpiai.txt

• A reminder regarding test submissions: you are only allowed to submit one

'.py' file for this unit test. If you are utilizing any code learned from development of

the my module from the Unit 4 course material, please update your program to

include anything from that module that it might need to run, in order to receive

credit for Unit 6. Do not import this module!/nYou can utilize the and keyword for the overall evaluation of conditions when you

write your program for this at-home test, and those for the remaining at-home

tests.

How to answer the at-home test: Once you are done writing your program for this at-

home test (test6.py), visit SUBMISSIONS in the course Blackboard to submit it as a file

attachment.

Testing: As you complete each unit, you apply your knowledge to completing an at-home

test - one per each of the eleven (11) units. Answering a test question located in this

module's "TESTS" area. Test questions are based on those you have already seen in each

unit. You will answer the test questions by writing a program. Make sure to save all of

your program files with .py extension! Otherwise, they cannot run, and running your

code is the only way you can be certain that your code works. If your program is

completed to my satisfaction according to the test constraints, I will note that you have

completed the unit and that you can move on to the next one (See note below on

reasonable programs). If I am not satisfied with your program, there is no penalty, but

you will have to take the test from the same unit next time.. If it does not run correctly

(or not at all) at first, do not give up! Go back to the code, try to find and correct the

mistake and run it again, until it runs and produces correct results./nYou should still be able to learn all the concepts as they are discussed in the

course material, with the changes and notes below.

NOTE 1: The two weblinks in the unit 6 'Learn something new' document are no longer

functional.

NOTE 1.A: For part 1, in part 2, and in part 3: http://meadoweast.com/csci133/hf.txt is no

longer functional.

• The example programs shown the later portion of part 1, in part 2, and in part

3 on pages 2 to 6 of unit 6 'Learn something new no longer execute the

expected output.

• If you would like to see the output of those example programs using the text file

directly:

1. download the actual hf.txt file itself, now located in the same shared

folder on Dropbox where all the screencasts are:

https://www.dropbox.com/sh/311fukdig0i5790/AABM77X2j9VIVA4cyLulMF

5la?dl=0&preview=hf.txt

2. Edit the example programs shown in part 1, in part 2, and in part 3 to

1. open that text file directly, instead of using the urllib.request module

and

2. split up the text with out the bytes method decode.

NOTE 1.B: For part 4 and in part 5, http://nancymcohen.com/csci133/cpiai.txt is no longer

functional.

The example programs in part 4 and part 5 still work but you must

use urllib.request to download CPI data

from https://futureboy.us/frinkdata/cpiai.txt.

NOTE 2: On page 8 of part 4 in unit 6 Learn something new, there is a Python concept

used within the example program of the CPI data processing that will not be covered in

explicit detail within this unit: the and keyword for the overall evaluation of

the if condition to describe two separate conditions as one single condition.

As of this unit, you may utilize this concept when running the example programs, writing

your practice programs, when working on the test for this unit, and for the remaining at-

home tests.

Question image 1Question image 2Question image 3Question image 4