In this challenge, a farmer is asking you to tell him how many legs can be counted among all his animals. The farmer breeds three species: chickens = 2 legs, cows = 4 legs, pigs = 4 legs. The farmer has counted his animals and he gives you a subtotal for each species. You have to implement a function that returns the total number of legs of all the animals.
Calculate the number of animal legs are on the farm. The function takes the following parameters: chickens, cows and pigs.
- Write your code in the function.
- Use the print statements to test your code.
- Run pytest as a final check
- Submit (remember: Stage, commit (with message) and then push)
Chickens: 2
Cows: 2
Pigs: 2
Total legs: 20
- Suggestions go here
- Use
input()to prompt the farmer for numbers of animals.
Add code to my_code.py to make it do the desired thing.
Run your code with: Run Python File in Terminal or use green arrow in upper right corner
Run your tests with: pytest