<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_best_int_float(val):
 """Get best type for value between int and float :param val: value :type val: :return: int(float(val)) if int(float(val)) == float(val), else float(val) :rtype: int | float 20.1 20 20 """

    integer = int(float(val))
    flt = float(val)
    # If the f is a .0 value,
    # best match is int
    if integer == flt:
        return integer
    return flt