Skip to content

athenian-computational-thinking/farm-problem-assignment-template-old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Farm Problem

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.

Problem Description

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)

Example

Chickens: 2
Cows: 2
Pigs: 2
Total legs: 20

Suggested Approach

  1. Suggestions go here

Hints

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages