<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rgb2hex(rgb, force_long=False):
 """Transform RGB tuple to hex RGB representation :param rgb: RGB 3-uple of float between 0 and 1 :rtype: 3 hex char or 6 hex char string representation Usage ----- '#0f0' Rounding try to be as natural as possible: '#0ff' And if not possible, the 6 hex char representation is used: '#3bffff' '#00ffff' """


    hx = ''.join(["%02x" % int(c * 255 + 0.5 - FLOAT_ERROR)
                  for c in rgb])

    if not force_long and hx[0::2] == hx[1::2]:
        hx = ''.join(hx[0::2])

    return "#%s" % hx