python check if string contains float or int