numbers question 4

added a function and a conditional to this answer