def covstr(strings):
    """ convert string to int or float. """
    try:
        result = int(strings)
    except ValueError:
        result = float(strings)
    return result
convert string to int or float.