In: Computer Science
I cannot get this code to run on my python compiler. It gives me an expected an indent block message. I do not know what is going on.
#ask why this is now happenning. (Create employee
description)
class employee:
def__init__(self, name, employee_id, department, title):
self.name = name
self.employee_id = employee_id
self.department = department
self.title = title
def __str__(self):
return '{} , id={}, is in {} and is a {}.'.format(self.name,
self.employee_id, self.department, self.title)
def main():
# Create employee list
emp1 = Employee(name='Susan Meyers', employee_id='47899',
department='Accounting', title='Vice President')
emp2 = Employee(name='Mark Jones', employee_id='39119',
department='IT', title='Programmer')
emp3 = Employee(name='Joy Rogersr', employee_id='81774',
department='Manufacturing', title='Engineer')
print(emp1, sep='/n/n')
print(emp2, sep='/n/n')
print(emp3, sep='/n/n')
if __name__=="__main__":
main()
class employee:
def __init__(self, name, employee_id, department,title):
self.name = name
self.employee_id = employee_id
self.department = department
self.title = title
def __str__(self):
return '{} , id={}, is in {} and is a {}.'.format(self.name, self.employee_id, self.department, self.title)
def main():
# Create employee list
emp1 = employee(name='Susan Meyers', employee_id='47899', department='Accounting', title='Vice President')
emp2 = employee(name='Mark Jones', employee_id='39119', department='IT', title='Programmer')
emp3 = employee(name='Joy Rogersr', employee_id='81774', department='Manufacturing', title='Engineer')
print(emp1, sep='/n/n')
print(emp2, sep='/n/n')
print(emp3, sep='/n/n')
if __name__=="__main__":
main()
*
please follow the screenshot to check for the indentation
and after class indentation should be there similarly for methods also and the final if statement also
and modified the class name in object creation as the class names are not matching