Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 3 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 upd_id(employees):
empid = input("Enter the employee ID: ")
new_id = input("Enter the new id of the employee: ")
found = False
i =0
for i in range(0,len(employees)):
if employees[i][0]== empid:
found = True
employees[i][0]= new_id
write_employees(employees)
break
def upd_id(employees):
empid = input("Enter the employee ID: ")
new_id = input("Enter the new id of the employee: ")
found = False
i =0
for i in range(0,employees):
if employees[i][0]== new_id:
found = True
employees[i][0]= empid
write_employees(employees)
break
def upd_id(employees):
empid = input("Enter the employee ID: ")
new_id = input("Enter the new id of the employee: ")
found = False
i =0
for i in range(0,employees):
if employees[i][0]== empid:
found = True
employees[i][0]= new_id
write_employees(employees)
break
def upd_id(employees):
empid = input("Enter the employee ID: ")
new_id = input("Enter the new id of the employee: ")
found = False
i =0
for i in range(0,len(employees)):
if employees[0][i]== empid:
found = True
employees[0][i]= new_id
write_employees(employees)
break

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain how DSL works.

Answered: 1 week ago

Question

9. Describe the characteristics of power.

Answered: 1 week ago