Don't really know how to word this but I'll try my best...

I made a simple little program after reading a few tutorials that asks for some information and then does some math etc.

One question asks for your age and you could put in: 15 years and it would crash because of the word 'years'. Is there a way I can ignore any words and only take the numbers?