Question: Create a class called Sports that contains 2 instance variables, name and number_of_players. Add the instance method, __str__, that allows you to customize the message
Create a class called Sports that contains 2 instance variables, name and number_of_players. Add the instance method, __str__, that allows you to customize the message returned when you print the instance so that it says The name of the sport is [name goes here] and [number_of_players goes here] people create one team! Create two instances of the class, one assigned to the variable football_info and one called quidditch_info. The first uses football as the name and has 11 players, the second uses quidditch as the name and has 7 players.
This is Python, Thank You
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
