Question: BlockPy: # 27.3) Animal Rater Create a function named rate_animal that will rate the value of animals on a numeric scale (1-4, where 1

BlockPy: # 27.3) Animal Rater Create a function named rate_animal that will

BlockPy: # 27.3) Animal Rater Create a function named rate_animal that will rate the value of animals on a numeric scale (1-4, where 1 is best and 4 is worst). Your function should consume a variable (holding a string value) 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. Unit test the result, but also use your function to print out your favorite animal's rating. This should be the animal that produces the value 1. Console: X * Feedback: Incorrect Answer Must Return in Function The function main is not returning. However, that function is supposed to have a return statement. O View Trace

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!