human
Can you provide a code to count Number of animals in a zoo from given number of head and legs and the other steps required given the following:
Count Number of animals in a zoo from given number of head and legs | Function that calculates Rabbits.
Driver code"
Solution in Python:
assistant
#Here is code to count Number of animals in a zoo from given number of head and legs and the other steps required.
 def countRabbits ( Heads , Legs ) :
	count = 0
	count = ( Legs ) - 2 * ( Heads )
	count = count / 2
	return count
if __name__ == ' _ _ main _ _ ' :
	Heads = 100
	Legs = 300
	Rabbits = countRabbits ( Heads , Legs )
	print ( " Rabbits ▁ = " , Rabbits )
	print ( " Pigeons ▁ = " , Heads - Rabbits )