Download and save the file hw05.py to your CS100/hw
folder.
This file is a template. It contains some code there for you. Put your name at the top of the file. Run it to test that it works. You should see the following as a result in the shell area:
Q1 - testA:
Q1 - testB:
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
----------------------
There are 13 questions total, worth either 1 or 1/2 point depending on the difficulty. The questions are written in comments. Each question involves you implementing a function below it to solve a specific problem.
I suggest you work one question at a time. Read the question description and write your solution. Before you move on, test that your solution is correct by uncommenting all lines of code which call the function at the bottom of the program. The first one is uncommented for you.
To help you check that your program produces the correct result, here is a sample output from my answer key. Your finished program should output the same once all your code is correctly added:
Q1 - testA: Python
Q1 - testB: Ada Lo
----------------------
Q2 - testA: bbage
Q2 - testB: ngine
----------------------
Q3 - testA: She envi ulators,
Q3 - testB: coining cience'.
----------------------
Q4 - testA: 13
Q4 - testB: 22
----------------------
Q5 - testA: 1
Q5 - testB: 2
----------------------
Q6 - testA: vxre are some fun facts about vxr
Q6 - testB: Svx was tvx daughter of tvx English poet Lord Byron
----------------------
Q7 - testA: 97
Q7 - testB: 65
----------------------
Q8 - testA: 4
Q8 - testB: NOT FOUND
----------------------
Q9 - testA: A
Q9 - testB: B
Q9 - testC: C
Q9 - testD: D
Q9 - testF: F
----------------------
Q10 - testA: 0
Q10 - testB: 25
Q10 - testC: 24
Q10 - testD: -1
----------------------
Q11 - testA: A
Q11 - testB: a
Q11 - testC: Z
Q11 - testD: y
Q11 - testE: ?
Q11 - testF: ?
----------------------
Q12 - testA: HelloCS100,whatabeautifulday
Q12 - testB: computerscienceisawesome
----------------------
Q13 - testA: its a great day punctuation is my friend said ee cummings
Q13 - testB: whle odded, early a, suddely there came a ta, as of some oe etly ra, ra at my chamber door.
You will be graded based on the quality of your code and that the output of each function matches the expected result. I will be checking to see that you correctly computed the solution programmatically.
In order to receive any credit, your program must run without syntax errors in Thonny.
Double check that your program runs without syntax errors. Submit the file hw05.py
updated with your changes to Moodle.