Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

no task 1-2-3... TASK 4 please 16 36 4e 17 Your task here is to complete the code required to intake the results of the

no task 1-2-3...
TASK 4 please
image text in transcribed
image text in transcribed
image text in transcribed
16 36 4e 17 Your task here is to complete the code required to intake the results of the test, 18 report the results and make hiring recommendations based on the test results. 19 20 import randon 21 random.seed (123) 22 num_applicants = 100 23 num_questions = 20 24 #results from the 20-question exam 25 results sheet = 0 26 for student in range(num_applicants): 27 #generate scores for each student and append to results sheet 28 scores = random.choices(list range(0,6)), kunum questions) 29 results sheet.append(scores) 30 #The result here is a list of lists. 31 32 #print out the first row of scores just as an example 33 print (results_sheet[0]) 34 35 Task 1: write a method in an external module and import it into this script 37 The my_module.py file contains a sample function that you can import into this program 38 This could look like: 39 from my_module import print_name 41 You need to write the code for the function sum_scorel) and use it to sum the values in results_sheet 43 IMPORT CODE HERE 44 45 #CODE TO SUM AND REPORT THE TOTAL RESULTS 45 totals should be a list of length - pum_applicants with the totals for each applicant 47 #HINT: you will a for- 48 totals 0 50 Task 2: Use try-except to check for an error with a list data type 52 next_applicant contains values that don't make sense to add up 53 maybe as a result of a typing mistake? 55 next_applicant = 10,4,2,3,'0',5,1,2,4,4,2,3,'0',4,5,'0', 1,2,3,4) 57 Use the module and function from task 1 above to try and sum the values in 58 "next_applicant' and show that an error is returned. 59 HINT: You will need to identify what is wrong with "next_applicant' in the code. 60 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. 62 63 #TASK 2 CODE HERE 65 #Task 3: Use if-else and euf to filter lists results sheet has a total of 100 summed values in it now, representing the scores 68 on a job entrance exam. You now need to do two things: 69 -Add an index to the list, i.e. the first applicant should be number 1, and so on. 70 -filter all the applicants into categories 71 -the categories are represented as lists: make_an_offer', 'waitlist, no_offer 72 -the minimum scores for being included in each -'make_an_offer":60 -'waitlist': 50 75 -'no_offer':

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions