Question: Your task here is to complete the code required to intake the results of the test, report the results and make hiring recommendations based on

Your task here is to complete the code required to intake the results of the test, report the results and make hiring recommendations based on the test results. ''' import random random.seed(123) num_applicants = 100 num_questions = 20 #results from the 20-question results_sheet = [] for student in range(num_applicants): #generate scores for each student and append to results_sheet scores = random.choices(list(range(0,6)),k=num_questions) results_sheet.append(scores) #The result here is a list of lists.

#print out the first row of scores just as an example print(results_sheet[0])

# Task 2: define a function named sum_score and use it to sum the values in results_sheet (1 points)

# Codes for the sum_score function def sumscore(a): #your codes here

#CODES TO SUM AND REPORT THE TOTAL RESULTS #'totals' should be a list of length = 'num_applicants' with the totals for each applicant #HINT: you will need a for-loop here

totals = [] # your codes here

#Task 3: Use try-except to check for an error with a list data type (1 point) ''' next_applicant contains values that don't make sense to add up maybe as a result of a typing mistake? ''' next_applicant = [0,4,2,3,'O',5,1,2,4,4,2,3,'O',4,5,'O',1,2,3,4] ''' Use the module and function from task 1 above to try and sum the values in 'next_applicant' and show that an error is returned. HINT: You will need to identify what is wrong with 'next_applicant' in the code. We can see that there are the letter 'O' in the list instead of number 0, but you need to help the program recognize that. ''' #Your codes here try: except:

#Task 4: Use if-else and elif to filter lists (2 points) ''' results_sheet has a total of 100 summed values in it now, representing the scores on a job entrance. You now need to do two things: -Add an index to the list, i.e. the first applicant should be number 1, and so on. -filter all the applicants into categories -the categories are represented as lists: 'make_an_offer', 'waitlist', 'no_offer' -the minimum scores for being included in each -'make_an_offer':60 -'waitlist': 50 -'no_offer': <50 -each elements in the lists above should have 2 parts: -applicant number -total score ''' make_an_offer = [] waitlist = [] no_offer = [] #Your codes here

#Task 5: Use text and strings to report the results of the script (2 points) ''' Now equipped with the scores for all the applicants, you can take the appropriate actions. For the applicants in 'make_an_offer', we will generate text to put in an offer letter. For 'waitlist' candidates, we will generate different text, and for 'no_offer' applicants, we will send a third string of text. The templates are below. You need to complete 2 tasks: -You need to generate a string for each of the 100 candidates, depending on which category they are in. -Use those string to create a list of strings in APPLICANT NUMBER ORDER, i.e. applicant #1 should be first, #2 second, etc. called 'letter_text' ''' offer_text = '''Congratulations {}! Your score of {} has earned you an offer from our company.''' waitlist_text = '''Hello applicant {}! Your score of {} was good, and we appreciate your desire to work here.''' no_offer_text = '''Hi applicant {}. Unfortunately your score of {} was strong enough with the high quality of applicants.'''

letter_text = [] #Your codes here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!