This situation can be written as (where x is the number of African animals):
172 = 1/2 * x + 45
172 = 1/2x + 45 / - 45 (both sides)
127 = 1/2x / * 2 (both sides)
x = 254
Doublecheck:
172 = 1/2 * 254 + 45
172 = 127 + 45
172 = 172
So it's correct :)
Answer: There are 254 African animals in the zoo.