def test_digit(arr):
 for element in arr:
  if (not element.isdigit()):
   print "Error: '{}' is not numeric.".format(element)
   exit(1)

def test_digit ( arr ) : for element in arr : if ( not element . isdigit ( ) ) : print "Error: '{}' is not numeric." . format ( element ) exit ( 1 )
exits if list contains non-numeric strings .