Question: Python Create a function named rate_animal that will rate the value of animals on a numeric scale (1-4). Your function should consume a string named

Python

Python Create a function named rate_animal that will rate the value of

Create a function named rate_animal that will rate the value of animals on a numeric scale (1-4). Your function should consume a string named an_animal and return an integer from 1-4 for each of four possible inputs: "dog", "cat", "capybara", and "danger noodle". Each animal should have its own value. If the string given is not a valid animal from the list, return -1.Call and print the function once with your favored animal

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 Databases Questions!