Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For the Employee Class Program in this tutorial, what if we need to search through the list of employees to find a specific one, update
For the Employee Class Program in this tutorial, what if we need to search through the list of employees to find a specific one, update the salary in it and save this information back in the employees.csv file? What code segment implements this in a method?
a
def updsalaryemployees:
empid inputEnter the employee ID:
newsal inputEnter the new salary of the employee:
found False
for i in rangeemployees:
if employeesi empid:
found True
employeesi newsal
writeemployeesemployees
break
b
def updsalaryemployees:
empid inputEnter the employee ID:
newsal inputEnter the new salary of the employee:
found False
for i in rangelenemployees:
if employeesi empid:
found True
employeesi newsal
writeemployeesemployees
break
c
def updsalaryemployees:
empid inputEnter the employee ID:
newsal inputEnter the new salary of the employee:
found False
for i in rangelenemployees:
if employeesi empid:
found True
employeesi newsal
writeemployeesemployees
break
d
def updsalaryemployees:
empid inputEnter the employee ID:
newsal inputEnter the new salary of the employee:
found False
for i in rangeemployees:
if employeesi newsal:
found True
employeesi empid
writeemployeesemployees
break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started