Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Identify High Turnover Departments | Reporting and Insights for HR
Python for HR Specialists

bookChallenge: Identify High Turnover Departments

In your HR data analysis journey, you have learned how to work with dictionaries to store and process structured information, such as employee or department data. Iterating through a dictionary allows you to access each key-value pair, making it possible to examine or manipulate the data based on specific criteria. Conditional logic, such as using an if statement, helps you filter out only the information that meets certain requirements. This skill is essential when you want to identify trends or outliers—like departments with unusually high turnover rates.

1234567891011121314
# Example: Identifying departments with turnover above a threshold department_turnover = { "Sales": 0.15, "Engineering": 0.08, "HR": 0.12, "Marketing": 0.09 } threshold = 0.10 for department, turnover in department_turnover.items(): if turnover > threshold: print(f"{department} has high turnover: {turnover:.0%}")
copy

When presenting the results, it is helpful to format your output so that high-turnover departments stand out clearly. You can print each qualifying department on a new line, including both the department name and its turnover rate as a percentage. Using string formatting, such as f"{value:.0%}", will display the turnover rate in an easy-to-read percentage format, making your HR reports more professional and actionable.

Compito

Swipe to start coding

Write a function that prints the names and turnover rates of all departments with turnover above the given threshold.

  • Iterate through each department and its turnover rate in the department_turnover dictionary.
  • For each department, check if the turnover rate is greater than threshold.
  • If the turnover rate is above the threshold, print the department name and turnover rate as a percentage using string formatting.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 5
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

bookChallenge: Identify High Turnover Departments

Scorri per mostrare il menu

In your HR data analysis journey, you have learned how to work with dictionaries to store and process structured information, such as employee or department data. Iterating through a dictionary allows you to access each key-value pair, making it possible to examine or manipulate the data based on specific criteria. Conditional logic, such as using an if statement, helps you filter out only the information that meets certain requirements. This skill is essential when you want to identify trends or outliers—like departments with unusually high turnover rates.

1234567891011121314
# Example: Identifying departments with turnover above a threshold department_turnover = { "Sales": 0.15, "Engineering": 0.08, "HR": 0.12, "Marketing": 0.09 } threshold = 0.10 for department, turnover in department_turnover.items(): if turnover > threshold: print(f"{department} has high turnover: {turnover:.0%}")
copy

When presenting the results, it is helpful to format your output so that high-turnover departments stand out clearly. You can print each qualifying department on a new line, including both the department name and its turnover rate as a percentage. Using string formatting, such as f"{value:.0%}", will display the turnover rate in an easy-to-read percentage format, making your HR reports more professional and actionable.

Compito

Swipe to start coding

Write a function that prints the names and turnover rates of all departments with turnover above the given threshold.

  • Iterate through each department and its turnover rate in the department_turnover dictionary.
  • For each department, check if the turnover rate is greater than threshold.
  • If the turnover rate is above the threshold, print the department name and turnover rate as a percentage using string formatting.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 5
single

single

some-alt