Question: Write a new function sound 2 ( weight , is _ cat ) that takes in not only the weight of the pet, but also

Write a new function sound2(weight, is_cat) that takes in not only the weight of the pet, but also a boolean value is_cat.
If is_cat is False, then the pet in question is a dog, so sound2 should call the sound function from Part A and return whatever sound returns.
However, if is_cat is True, then the pet being tested is a cat, so sound2 should just return the string 'Meow' regardless of the weight.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!