Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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