Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a python question. If possible, I need it by 7:15 pm central standard time, thanks. Question 1 (50 points) Write a class named
This is a python question. If possible, I need it by 7:15 pm central standard time, thanks.
Question 1 (50 points) Write a class named string_list that inherits from list. You can assume only string will be added to the list. Hint: You should not have to implement a constructor or the append method. string_list is a list with some additional methods: Proper Inheritance: (20 points). O points of 20 if it doesn't inherit from list! largest() : returns the largest string, based on length, in the list. Returns an empty string " if the list is empty. (10 points) smallest() : returns the smallest string , based on length, in the list. Returns an empty string " if the list is empty. (10 points) combined() : returns a single string with all the strings in the list concatinated and seperated by a space (don't worry about trailing space). Returns an empty string" if the list is empty. (5 points) finder(value) : returns a list of all the strings in the list that have a specific value passed in as a parameter. Returns an empty list if there are no strings. (5 points) Example Usage: I=string_list() 1.append('cat') 1.append('wolf') 1.append('whale') I.largest() -> will return 'whale' I.smallest() -> will return 'cat' I.combined() -- -> will return 'cat wolf whale' l.finder('a') -> will return ['catwhale']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