Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You work for a company that manages employee records as follows. ( Al ce , HR , 2 8 , 5

You work for a company that manages employee records as follows.("Alce","HR",28,55000.0),("Charlie", "Marketing", 25,48000.0),("Eve", "Engineering", 29,60000.0)
]Each employee is represented by a tuple containing their name (string), department (string), age (integer), and
salary (float).
Your task is to write Python code to sort the employee records in ascending order of age. After sorting, create a
new list called young_employees containing the names and departments of employees younger than 30 years
old, discarding their ages and salaries. Finally, print the young_employees list. The expected output may look
like:
[('Charlie', 'Marketing'),('Alice','HR'),('Eve', 'Engineering')]
image text in transcribed

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions