Skip to content

have a problem about the function of sort() #611

@wxde

Description

@wxde

i want a list sorted by the lenght of str. the environment is python3.6

"strs.sort(lambda x,y:cmp(len(x),len(y)))"

the error : TypeError: must use keyword argument for key function

i don't know where is the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions