Assessment 2 Final v0.1
Assessment 2 Final v0.1
Assessment 2 questions:
1. Read the attached text file and print the total number of lines. (5 Points)
test.txt
2. Read the attached csv file, (15 Points)
a. Print Inspection ID of Restaurants with High Risk value “Risk 1(High)”.
b. Print License # and Inspection Date of Restaurants having VENTILATION violations.
fiveguys.csv
https://docs.python.org/3/library/csv.html
3. Create 4 functions to perform arithmetic operations. Write all outputs to a single text file. Use
below table for function names and parameter values. (15 Points)
4. Write at least 10 unit tests to validate the functions from Question #3 (15 Points)
https://docs.python.org/3/library/unittest.html
code.txt
6. Here is our Question Generator program. (25 Points)
a. Add logic to method “add_to_bucket” to prevent duplication. Use question id as a
unique identifier.
b. The hint from question 2 got added to question 1. Please fix the bug.
Script output:
{'question_id': 1, 'question_description': 'is python easy to learn?', 'question_hints': ['coding standards', 'pythonic
way']}
{'question_id': 2, 'question_description': 'what is pep8 standards?', 'question_hints': ['coding standards', 'pythonic
way']}
code.txt