In this lab, you will practice:
Assume there is a job finding agency and they can get you a job based on your age and height. You will create a function that takes the age and height as parameters and returns the department in which you will be working at. Finally, you will get the working hours per week from a dictionary. In this dictionary, the department is the key and the number of working hours per week is the value
if age greater than or equal to 20 and age less than 40:
If height greater than or equal to 150 and height less than 170: the department should be “Human Resources”
If height greater than or equal to170 and height less than or equal to180: the department should be “Marketing”
Otherwise: the department should be “Sales”
If age greater than or equal to 40 and age less than or equal 60:
If height greater than or equal to 150 and height less than 170: the department should be “Finance”
If height greater than or equal to 170 and height less than or equal to 180: the department should be “Administration”
Otherwise: the department should be “R & D”
Otherwise: the department should be “IT”
Create a dictionary with the departments as keys and the working hours as values. Below are the details for the keys and values:
After you get the department from the function, get the working hours from the dictionary and print the following statement with the substitution for AGE, HEIGHT, HOURS, and DEPARTMENT with their corresponding values:
My age is AGE and my height is HEIGHT. I work HOURS hours per week in DEPARTMENT.
Input
23 166
Output
My age is 23 and my height is 166. I work 20 hours per week in Human Resources.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more
Recent Comments