BlockPy: # 27.3) Animal Rater Create a function named rate_animal that will rate the value of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Norway has a long tradition of boatbuilding stretching back to before Viking times. This is due, no doubt, to Norways proximity to the sea, ample forests, and long coastline. Among luxury sailing...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Briefly explain the meaning of the following concepts and terms: greenhouse gases (GHGs), the IPCC, the little ice age, the Keeling graph, telekinetic property of the atmosphere, global weirding,...
-
In the hydraulic system shown in FIGURE 15-40, the piston on the left has a diameter of 5.1 cm and a mass of 2.3 kg. The piston on the right has a diameter of 13 cm and a mass of 3.6 kg. If the...
-
Selected accounts from the Pearson, Gomez, and Litt Partnership adjusted trial balance for the year ended December 31 follow. Prepare a classified balance sheet. $10,000 15,000 20,000 5,000 $ 5,000...
-
Air at \(25^{\circ} \mathrm{C}\) flows normal to the axis of an infinitely long cylinder of \(1.0-\mathrm{m}\) radius. The approach velocity is \(100 \mathrm{~km} / \mathrm{hr}\). Find the rotational...
-
Kumar Company has two producing departments and two support centers. The following budgeted data pertain to these four departments: Required: 1. Allocate the overhead costs of the support departments...
-
1. Write a program in python to get the number of rows using GUI. If the user entered less than 4 rows, display the message not to enter less than 4 rows and allow the user to enter again. For...
-
A triglyceride composed of three 18 carbon chains fatty acids. Assuming that this entire triglyceride undergoes the catabolic process of beta oxidation to obtain energy for the body. How many rounds...
-
Find all relative extrema of the function. (If an answer does not f(x) = 2x24x1/3 (x, y) = (DNE relative maximum relative minimum (x, y) = (DNE Need Help? Read It Submit Answer
-
Briefly describe tax administrative matters including: Tax collection and withholding mechanisms (PAYG withholding, PAYG instalments).
-
A 13m long ladder is leaning against a wall. The top of the ladder is sliding down the wall at a constant speed of 5m/s. How quickly is the bottom of the ladder moving away from the wall when the top...
-
How to differentiate the essential attributes of quality financial statements that can be found in Coca-Cola and Pepsi Companies.
-
The radius of a spherical balloon is increasing at a rate of 2 centimeters per minute. How fast is the surface area changing when the radius is 8 centimeters? Hint: The surface area is S = 4r. Rate...
-
When recruiting and acquiring resources and services, you need to be aware of intellectual property rights and responsibilities. Non-compliance with intellectual property requirements can result in...
-
As you rewrite these sentences, replace the cliches and buzzwords with plain language (if you don't recognize any of these terms, you can find definitions online): a. Being a jack-of-all-trades, Dave...
-
Touchie MacFeelies irascible business manager, Gander Mac- Grope, announces that old jokes can be purchased for $1 each and that the wage rate of cartoonists labor is $2. (a) Suppose that in the...
-
The athletic director discussed in the last problem is considering the extra revenue he would gain from three proposals to expand the size of the football stadium. Recall that the demand function he...
-
Farmer Alf Alpha has a pasture located on a sandy hill. The return to him from this pasture is a random variable depending on how much rain there is. In rainy years the yield is good; in dry years...
-
For many years, womens professional basketball struggled for consistency in the United States. Since 1978, when the Womens Professional Basketball League (WBL) was formed, leagues have had difficulty...
-
What are the five forms of financing, and how is each used within sport?
-
That financial ratios are most valuable when viewed in comparison to the organizations historical ratio values and competitors values. Why is this context valuable when examining financial ratio...
Study smarter with the SolutionInn App