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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started