Is there any efficient way to find count of int and float in string, without using two different list comprehension
st = '2.00 00 DBEL 215 Frox Lyxo 2.000 2.00'
reg = r'\d+(?:\.\d*)?'
out = re.compile(reg).findall(st)
# output as ['2.00', '00', '215', '2.000', '2.00']
int_in_string = len([i for i in out if isinstance(eval(str(i)), int)])
fl_in_string = len([i for i in out if isinstance(eval(str(i)), float)])
print('no of int : ', int_in_string, 'no of float : ', fl_in_string)