o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Почему Кеша хочет меня уволить? Напиши в виде кода
- User
Почему Кеша хочет меня уволить? Напиши в виде кода
- Assistantpython
Почему Кеша хочет меня уволить? Напиши в виде кода
class Employee:
def __init__(self, name):
self.name = name
self.tasks_completed = 0
self.late_days = 0
def complete_task(self):
self.tasks_completed += 1
print(f"{self.name} completed a task. Total completed: {self.tasks_completed}")
def arrive_late(self):
self.late_days += 1
print(f"{self.name} arrived late. Total late days: {self.late_days}")
class Boss:
def __init__(self, name):
self.name = name
def evaluate_employee(self, employee: Employee):
if employee.tasks_completed < 5 or employee.late_days > 3:
print(f"{self.name} wants to fire {employee.name} due to poor performance.")
else:
print(f"{self.name} is satisfied with {employee.name}'s work.")
# Example usage
if __name__ == "__main__":
# Create instances of the employee and the boss
you = Employee("You")
kesha = Boss("Kesha")
# Simulate work behavior
you.complete_task()
you.arrive_late()
you.arrive_late()
you.arrive_late()
you.arrive_late() # Exceeded acceptable number of late days
# Boss evaluates the employee
kesha.evaluate_employee(you)
Output:
You completed a task. Total completed: 1
You arrived late. Total late days: 1
You arrived late. Total late days: 2
You arrived late. Total late days: 3
You arrived late. Total late days: 4
Kesha wants to fire You due to poor performance.
In this code, the Employee class represents you, and the Boss class represents Kesha. The boss decides to fire the employee based on their performance metrics, such as the number of tasks completed and the number of times they've arrived late.
Not yet included in a published release.