forked from tdwojak/Python2017
22 lines
362 B
Python
22 lines
362 B
Python
#!/usr/bin/env python2
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import math
|
|
|
|
|
|
def is_numeric(lista):
|
|
bool = False
|
|
for i in lista:
|
|
bool = isinstance(i, int) or isinstance(i, float)
|
|
if not bool:
|
|
return False
|
|
return bool
|
|
|
|
print(is_numeric([-1,2.1,3]))
|
|
|
|
print(is_numeric([-1,2.1, '3',3]))
|
|
|
|
print(is_numeric(['2']))
|
|
|
|
print(is_numeric([None]))
|