Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
If else if in 2 ways
Gedanken Tests - inner Class, Struct ..
Ваня и забор
Filtering texts within brackets
inerse_matrix_gauss_jordan
delta5
pytest
Omirp
teste
количество 1 и 0 в последовательности чисел до n
stackse - search stackoverflow differently
Please log in to post a comment.