Question: Task: Make class Employee and its initialization method. Employee-class will have 2 attributes: id and name. Make program, filling the list with objects of Employee

Task:

Make class Employee and its initialization method. Employee-class will have 2 attributes: id and name.

Make program,

  • filling the list with objects of Employee class. Id is a serial number from 1 and name will be asked from user.
  • ending when user gives '0' instead of a name.
  • in the end printing all Employees from list in a format shown in example below.

You must use: class, def, for"

Example output:

Please enter employee name (0 to quit):Jane Doe Please enter employee name (0 to quit):John Johnson Please enter employee name (0 to quit):Richard Roe Please enter employee name (0 to quit):0 Id: 1 Name: Jane Doe Id: 2 Name: John Johnson Id: 3 Name: Richard Roe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!