Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте 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.

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

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.

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 5
single

single

some-alt