Below you can see the class Task. Any task has a description and a person responsible for finishing this task. In our class, these aspects are represented by instance attributes description and team.
Sometimes we may want to combine tasks together (that is, add them up). Define the method __add__ that:
- combines the descriptions of two tasks. Two descriptions should be on different lines;
- combines the two teams responsible for different tasks. They should be separated by a comma and a whitespace.
Here's an example:
task1 = Task("Finish the assignment.", "Kate")
task2 = Task("Prepare the project for class.", "James, Ann")
task3 = task1 + task2
task3.description # "Finish the assignment.\nPrepare the project for class."
task3.team # "Kate, James, Ann"
You just need to define the method, do not call or print anything.