Question: Using Python: 1- Write a function (getWords) that takes a single argument (sentence), and returns a list of words from sentence. You can assume that
Using Python:
1- Write a function (getWords) that takes a single argument (sentence), and returns a list of words from sentence. You can assume that words are only separated by spaces.
Note: You can use len(), [:], [], and for loops, but you cannot use other built-in functions like split() and partition().
2- Write a class (Pet) that stores an instance variable string (name). Write three additional classes (Dog, Cat, Bird) that inherit from Pet, each of which will have a speak() function that will return the name of the pet, a dash, and then the sound for each pet (see the table below).
Pet Dog Cat Dird Cheep Sound Woof! Meow
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
