Level 10 : How does the sort() method work in Python?


sort_list = lambda x:x.sort()
numbers = [9,2,7,2]
sort_list(numbers)
print(numbers)

Author: Pavan | Tags: sorting | 1736+ Python FAQs | Share
magic-method | python-module | loop | logical-operation | generators-in-python | max-min | function-argument | list-operation | sys | type_conversion | name-mangling | input-function | overflow | decorator | bitwise-operator | scientific-notation | syntax | fabs-function | update | arithmetic-operation | filter-function | staticmethod | class-and-inheritance | polymorphism | matrix | round-function | parameter | dictionaries | lists | asyncio-module | built-in-function | functional-programming | python_version | destructor | __init_subclass__ | mutable | indentation | math-copysign | version | pep | statement | while-and-for-loop | pandas | for | copy | format | class | python-history | expression | string-manipulation | encapsulation | global-variable | collection | binary-operation | while-else-loop | syntaxerror | assert | counter-function | package-management | virtual-environment | memory-management | context-manager | error | floating-point-precision | set | stack | regular-expression | string-concatenation | async | generators | pickling-&-unpickling | objects | sum-function | function-and-scope | enumerate() | mathematical-function | identity-operator | dictionary | logical-operator | zip | tuple-unpacking | list-method | goto-function | python-repl | collections | design-principle | conversion | classes | datatype | odd-number | python-django | lambda-function | bitwise-operator | comprehension | integer | exception-handling | init | datetime | binary | call | decimal | multiprocessing | list-vs-tuple | encoding | append | id-function | bitwise | global-keyword | string-formatting | generator | __all__-attribute | condition | math | numeric | version-check | immutable-data-type | debugging | turtle | sorted | string-slicing | heap-memory | recurssion | feature | error-handling | data_structure | return-statement | touples | else-statement | map-function | typeerror | list-comprehension | data-type | oop | while-loop | deep-copy | input-function | thread | exponentiation | descriptors | data-structures | random | file | implementation | identity-operator | counter | file_handling | string-formatting | default-mutable-argument | rollback | multithreading | benefit | loop-control | interpreter | keyword | def | function | matplotlib | method | precedence-and-associativity | expand-tab | virtual-environment | choice | data-structure | arithmetic-expression | docstring | range | slicing | conditional-statement | identifier | iterator | min-max-function | file-handling | command-line-parsing | data-structure | syntax-error | filter | min-function | string-iteration | syntax-error | functions | nested-loop | comment | list-indexing | control-flow | random-function | operator-overloading | operand | lambda | type-conversion | array | indexing | threading | lambdas | operator-and | factorial-function | mathematics | variable | multiple-inheritance | boolean | int | conditional-statement | global | list-comprehension | list-mutation | asyncio | postfix | list-slicing | control-statement | tuple | comparison | recursion | dicts | immutability | invalid-list | complex-number | sorting | mysql | split | escape-operator | string | with-statement | class-and-instance-variable | string-method | class-and-object | namedtuple | center | input | mapping-function | memory | iterable | built-in-function | static-method | object-attribute | zfill-function | slice | __future__ | type-conversion | library | matrix-list-comprehension | numpy | precedence | compute | file-handling | exception-handling | boolean-and-non-boolean | control-flow | pseudocode | join | inheritance | methods | operators | sys-module | application | constructor | frozenset | import-method | zip-function | sum() | list | logical-operator | yield | inherit | complex | data-type | shallow-copy | match | assignment-operator | attribute | print-statement | namespace | software-design | operator | set-operation | basic | built-in | loops | regex | print | round | installation | list-join | formal-and-actual-parameter | global-variable | higher-order-function | string-slicing | oops | exception | raise | operations | gil | python | swapping | head-and-tail | access-modifier | module | string-method | operator-or ...