Use exception handling and int() here:
>>> def func(x):
... try:
... return int(x)
... except ValueError:
... return x
...
>>> inputText = "John Smith 5"
>>> spl = [func(x) for x in inputText.split()]
>>> spl
['John', 'Smith', 5]
If you're sure it's always the last element that has to be converted then try this:
>>> inputText = "John Smith 5"
>>> spl = inputText.split()
>>> spl[-1] = int(spl[-1])
>>> spl
['John', 'Smith', 5]
use nameArray.append to append the new list to it:
>>> nameArray = [] #initialize nameArray as an empty list
>>> nameArray.append(["John", "Doe", 5]) #append the first name
>>> spl = [func(x) for x in inputText.split()]
>>> nameArray.append(spl) #append second entry
>>> nameArray
[['John', 'Doe', 5], ['John', 'Smith', 5]]