Created
May 9, 2018 15:01
-
-
Save Demandrel/5e09c00e918551197917bfdc7f53e67f to your computer and use it in GitHub Desktop.
Script Defi codeWar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def animalYears (firtYear, secondYear, afterThirdYear, animalYears) | |
HumanYears = 0 | |
res = animalYears - firtYear | |
if res <= 0 | |
HumanYears = 1 | |
return HumanYears | |
res = res - secondYear | |
if res <= 0 | |
HumanYears = 2 | |
return HumanYears | |
while res > 0 | |
res = res - afterThirdYear | |
HumanYears = HumanYears +1 | |
return HumanYears | |
def owned_cat_and_dog(cat, dog) | |
ownedCat = animalYears(15, 9, 4, cat) | |
ownedDog = animalYears(15, 9, 5, dog) | |
return [ownedCat, ownedDog] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment