Question: For the Employee Class Program in the Unit 3 Finishing the Employee Class Program tutorial, what if we need to search through the list of
For the Employee Class Program in the Unit Finishing the Employee Class Program tutorial, what if we need to search through the list of employees to find a specific one, change their id and save this information back in the employees.csv file? What code segment implements this in a method?
def updidemployees:
empid inputEnter the employee ID:
newid inputEnter the new id of the employee:
found False
i
for i in rangelenemployees:
if employeesi empid:
found True
employeesi newid
writeemployeesemployees
break
def updidemployees:
empid inputEnter the employee ID:
newid inputEnter the new id of the employee:
found False
i
for i in rangeemployees:
if employeesi newid:
found True
employeesi empid
writeemployeesemployees
break
def updidemployees:
empid inputEnter the employee ID:
newid inputEnter the new id of the employee:
found False
i
for i in rangeemployees:
if employeesi empid:
found True
employeesi newid
writeemployeesemployees
break
def updidemployees:
empid inputEnter the employee ID:
newid inputEnter the new id of the employee:
found False
i
for i in rangelenemployees:
if employeesi empid:
found True
employeesi newid
writeemployeesemployees
break
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
