Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
chickens,cows,pigs
""" 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. Examples animals(2, 3, 5) ➞ 36 """ print("returns the total number of legs of all the animals") print("chickens = 2 legs\ncows = 4 legs\npigs = 4 legs") chickens=2 cows=4 pigs=4 print("enter the no of chickens") chic=int(input()) print("enter the no of cows") cows1=int(input()) print("enter the no of pigs") pigs1=int(input()) def animals(chickens,cows,pigs): return chic*chickens+cows1*cows+pigs1*pigs print(animals(chickens,cows,pigs))
run
|
edit
|
history
|
help
0
>= Number regex generator for Annish
mean
PyRegCapGroup
Game2
Adivina el número
PyNewInit
Minimum Positive Integer
f strings 3
First
wrong update class