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
Right_Align_Text
Find numbers with given sum of digits
PyNoneOr
Lesson6 part b
list_copy_shallow_deep.py
Mengira luas dan perimeter segi tiga
no count xo
Rextester
ejemplo2_python_20.068.214-9
var_local_global.py