Question: Implement the functions below in a file called csc242hw1.py a template for which has been provided on the D2L site. You must include appropriate doc
Implement the functions below in a file called csc242hw1.py a template for which has been provided on the D2L site. You must include appropriate doc strings (e.g. strings that appear on the line following the class or function header ask if you don't know what I mean) to the functions that clearly and concisely describe what the functions are doing. A submission without doc strings will not earn full credit. Question 5 (25 points): Write a function even() that takes in as a parameter a file name. The file name contains a list of integers, one on each line blit there may be bad data. The function will return a list of all of the even numbers found in the file and should not crash if it encounters non-numeric input. The function should catch all file access and conversion errors (ValueError). Upload your test file to D2L. >>>print (even('qs-input.txt)) The value 'b could not be converted to an int 12, 4, 6, 8 Question 6(25 points): Write a function named survey(). The function asks the user for 3 pieces of information: full name, city they were born in and age. The function appends that information the user entered to a file and tracks all the results of the survey. Each survey is on its own line in the file and each answer is separated by a ". When the user is done with the survey, the function should print a thank you message to the screen with a summary of what the user entered. The function should catch all file access errors. The file should like something like this after 3 runs of the function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
