Update sal_json.py#8
Conversation
| class Emplyee: # Error: Typo in class name | ||
| def __init__(self, emp_id, name, position, salary): # Error: Wrong parameter name (emp_id should be employee_id) |
There was a problem hiding this comment.
suggested comment:
Input: def give_rais(self in 5
| def __init__(self, emp_id, name, position, salary): # Error: Wrong parameter name (emp_id should be employee_id) | ||
| self.emp_id = emp_id # Error: Wrong attribute name (self.emp_id should be self.employee_id) |
There was a problem hiding this comment.
suggested comment: self.employee_id = emp_id in 6
| self.emp_id = emp_id # Error: Wrong attribute name (self.emp_id should be self.employee_id) | ||
| self.name = name |
There was a problem hiding this comment.
suggested comment: self.employee_id = emp_id in 7
| 'employee_id': self.emp_id, # Error: Wrong attribute name (self.emp_id should be self.employee_id) | ||
| 'name': self.name, |
There was a problem hiding this comment.
suggested comment: 'employee_id': self.employee_ in 17
| employee = Emplyee( # Error: Typo in class name | ||
| emp_id=row['employee_id'], # Error: Wrong parameter name (emp_id should be employee_id) |
There was a problem hiding this comment.
suggested comment: NameError: name 'Emplyee' is in 32
| emp_id=row['employee_id'], # Error: Wrong parameter name (emp_id should be employee_id) | ||
| name=row['name'], |
There was a problem hiding this comment.
suggested comment:
Input: name=row['name'], in 33
| def main(): # Error: Missing indentation for this function | ||
| input_file = 'employees.csv' # Error: Incorrect indentation |
There was a problem hiding this comment.
suggested comment: SyntaxError: expected an indented block
Input in 47
| input_file = 'employees.csv' # Error: Incorrect indentation | ||
| output_file = 'employees.json' # Error: Incorrect indentation |
There was a problem hiding this comment.
suggested comment: IndentationError: expected an indented block in 48
| output_file = 'employees.json' # Error: Incorrect indentation | ||
|
|
There was a problem hiding this comment.
suggested comment: IndentationError: expected an indented block in 49
| employees = read_employees_from_csv(input_file) # Error: Incorrect indentation | ||
| for employee in employees: |
There was a problem hiding this comment.
suggested comment: employees = read_employees_from_csv in 52
| employee.give_raise(5000) # Error: Incorrect indentation | ||
| save_employees_to_json(employees, output_file) # Error: Incorrect indentation |
There was a problem hiding this comment.
suggested comment: employee.give_raise(500 in 54
| save_employees_to_json(employees, output_file) # Error: Incorrect indentation | ||
| print(f"Employee data has been saved to {output_file}") # Error: Incorrect indentation |
There was a problem hiding this comment.
suggested comment: save_employees_to_json(employees in 55
| print(f"Employee data has been saved to {output_file}") # Error: Incorrect indentation | ||
| except Exception as e: |
There was a problem hiding this comment.
suggested comment: print(f"Employee data has been saved in 56
| print(f"An error occurred: {e}") # Error: Incorrect indentation | ||
|
|
There was a problem hiding this comment.
suggested comment: An error occurred: {e} # Error in 58
No description provided.