7.5 points The following code is meant to calculate the ave…
7.5 points The following code is meant to calculate the average salary of employees, but it contains errors. Identify the line numbers that would raise exceptions when executed. 1. employees = { ‘Alice’: (28, 5000), ‘Bob’: (34, 6000), ‘Clara’: (25, 4500)}2. departments = {‘HR’, ‘IT’, ‘Design’}3. employees[‘Bob’][1] = 6200 4. departments.add([‘Finance’, ‘Admin’]) 5. employees.add((‘David’, (30, 5500))) 6. first_dept = departments[0] 7. total = 08. for person in employees:9. total += employees[person][1]10. average = total / len(employees)11. print(“Average salary:”, average)
Read Details