Checks the format of a MAC address and returns it without double-colons and in capital letters, if it is correct. Otherwise it returns None.
    * it accepts the format of the double colons and a single hex string

def check_mac(original_mac):
    '''
    Checks the format of a MAC address and returns it without double-colons and in capital letters, if it is correct. Otherwise it returns None.
    * it accepts the format of the double colons and a single hex string
    '''
    mac = (original_mac.upper()).strip()
    parts = mac.split(':')
    if len(parts) == 6:
        # let's think that it is a : separated mac
        for p in parts:
            if len(p) != 2:
                return None
        mac = ''.join(parts)
    elif len(parts) > 1:
        return None
    for c in mac:
        if c not in '0123456789ABCDEF':
            return None
    return mac