>>> def validate(usernames): if (len(usernames) > 4) and (len(usernames) < 12): return usernames
>>> print filter(validate, ('admin', 'maxianglin', 'lin', 'adm', 'wanglili','linghu'))('admin', 'maxianglin', 'wanglili', 'linghu')>>>