def list_add_capitalize ( l ) : nl = [ ] for i in l : nl . append ( i ) if hasattr ( i , "capitalize" ) : nl . append ( i . capitalize ( ) ) return list ( set ( nl ) )
no attribute 'capitalize' python
def list_add_capitalize(l):
    """
    @type l: list
    @return: list
    """
    nl = []

    for i in l:
        nl.append(i)

        if hasattr(i, "capitalize"):
            nl.append(i.capitalize())

    return list(set(nl))