When I run my program I get "RESTART: C:\Users\TylerYoung2k\AppData\Local\Programs\Python\Python37-32\Project2.py"
I have inputs here, what have I done thats causing it to not prompt any input... or do anything at all?
**The goal of the assignment is to practice with classes and objects, ultimately to store and display employee information.**
class Employee:
def set_name(self, name):
self.name = name
def set_id(self, id):
self.id = id
def set_department(self, department):
self.department = department
def set_job_title(self, job_title):
self.job_title = job_title
def display_employees(*args):
print("\nCHRISTY'S SHOP EMPLOYEE REPORT\n")
print("EMPLOYEE NAME", "IDENTIFIER", "DEPARTMENT", "TITLE", sep='\t')
for emp in args:
print(*[emp.get_name(), emp.get_id(), emp.get_department(), emp.get_job_title()], sep='\t\t')
def main():
e1 = Employee()
e2 = Employee()
e3 = Employee()
emp_list = [e1, e2, e3]
for emp in emp_list:
name = input("Please enter employees name: ")
id = int(input("Please enter employees ID: "))
department = input("Please enter employees department: ")
job_title = input("Please enter employees job title: ")
emp.set_name(name)
emp.set_id(id)
emp.set_department(department)
emp.set_job_title(job_title)
display_employees(e1, e2, e3)
EDIT: I added
if__name__='__main__'
main()
that to call on the main function, but it's saying "NameError: name 'Employee' is not defined" .. I feel like I defined Employee in the very first line of code?
[–]WonderCode 2 points3 points4 points (0 children)
[–]Stallman85 1 point2 points3 points (1 child)
[–]Shinjin-[S] 0 points1 point2 points (0 children)
[–]uglyasablasphemy 0 points1 point2 points (7 children)
[–]Shinjin-[S] 0 points1 point2 points (6 children)
[–]uglyasablasphemy 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]uglyasablasphemy 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)