Python - Challenge 2
📖 Read the lesson
Code Life
By Pierre Marsaa
Team Builder
Create a
Team
class to manage Codémon:
1.
__init__(self, name)
— team name and empty
members
list
2.
add(self, codemon)
— add a Codémon to the team
3.
remove(self, name)
— remove a Codémon by name
4.
show(self)
— print the team name and all members
5.
__len__
— return the number of members
Test by adding 3 Codémon, removing one, and printing the team size.
↗️
Loading editor...
↶
▶️ Run
↷
💡 Show Solution
Continue