Level 9 : What is the output?


vals = ["1", "20", "3"]
print(sorted(vals, key=int))

Author: VenuEmmela | Tags: list | 1859+ Python FAQs | Share
built-in-function | assignment-operators | class-and-object | interpreter | error-handling | list-comprehension | basic | static-method | docstring | filtering-and-indexing | mathematics | functional-programming | list-slicing | feature | namedtuple | global-variable | matplotlib | list-method | max-min | global-keyword | class-decorators | using-os-and-pathlib-modules | sorting | matrix-list-comprehension | advanced-file-operations | rollback | array | else-statement | regex | set-operation | sys | arbitrary-arguments-(*args,-**kwargs) | shallow-copy | command-line-parsing | error | file_handling | call | matrix | memory-management | staticmethod | benefit | built-in-modules | data_structure | string | conversion | file | sum() | string-method | logical-operator | sorting-and-ranking | function-argument | memory | string-methods | string-slicing | error-handling | list-vs-tuple | filter | recurssion | string-formatting | stack | creating-and-starting-threads | exception | min-function | directory-operations | encoding | expression | literal-characters-and-special-characters | dictionary | software-design | multiple-inheritance | logical-operator | multiple-except-blocks | formatting-with-strftime | map-function | encapsulation | multiprocessing | filter-function | datetime.date,-datetime.time,-datetime.datetime | logical-operators | set | sorted | return-statement | string-method | regular-expression | string-iteration | booleans | round | recursion | __init_subclass__ | gil | goto-function | asyncio | floating-point-precision | generator | datatype | round-function | single-inheritance | slicing | test-discovery | methods | mathematical-function | loop-control-statements | syntax | dicts | pep | type-conversion | binary | multiple-inheritance | mutable | built-in-function | data-type | control-flow | exception-handling | comprehension | objects | loop | match | else | type_conversion | name-mangling | slice | syntax-error | typeerror | reading-and-writing-files | async | attribute | expand-tab | collections | regular-expressions | for | python-syntax-and-structure | while-and-for-loop | binary-operation | membership-operators-(in,-not-in) | control-flow | operand | reading-and-writing-large-files-efficiently | complex-number | generators | access-modifier | lists | decimal | escape-operator | center | why-use-multiprocessing-over-threading?-(gil) | syntax-error | boolean-and-non-boolean | while-loop | generators-in-python | factorial-function | floats | using-lists-as-stacks | functions | global-variable | string-concatenation | print-statement | exponentiation | exception-handling | sys-module | context-manager | precedence | mysql | virtual-environment | application | working-with-file-paths | logical-operation | bitwise-operator | comment | class | overflow | class-and-instance-variable | boolean | min-max-function | precedence-and-associativity | string-formatting | append | creating-custom-modules | list,-set,-and-dictionary-comprehensions | python_version | copy | def | difference-between-threads-and-processes | method-overloading | yield | strings | reading:-read(),-readline(),-readlines() | data-structure | using-yield-in-functions | datetime | namespace | using-assertions-(assertequal,-assertraises) | data-structure | data-type-conversions | bitwise | boolean-masking | condition | counter-function | string-slicing | data-type | constructor | package-management | string-manipulation | conditional-statement | __future__ | comparison | counter | list-mutation | type-conversion | scientific-notation | polymorphism | split | assignment-operator | sets | magic-method | list-methods-and-slicing | managing-directories-with-os-and-shutil | version-check | zfill-function | statement | oops | data-structures-in-python | mapping-function | update | arithmetic-expression | dictionary-comprehensions | sum-function | loop-control | data-types | assert | bitwise-operator | decorator | classes | math | arithmetic-operation | swapping | syntaxerror | descriptors | built-in | operators | module | dataframe-and-series-objects | quantifiers-(*,-+,-?,-{}) | conditional-statement | asyncio-module | __all__-attribute | threading | dictionaries | math-copysign | using-the-threading-module | complex | default-arguments | conditional-statements | aggregating-data-with-functools.reduce() | method | control-statement | anchors-(^,-$) | dictionary-methods | destructor | class-and-inheritance | walking-through-directories-using-os.walk() | compute | debugging | deep-copy | choice | type-conversion-and-casting | enumerate() | defining-functions | design-principle | multithreading | operations | data-structures | formal-and-actual-parameter | loops | global | default-mutable-argument | time-series-with-pandas | random-function | file-handling | python | using-join()-and-is_alive()-methods | file-handling | fabs-function | list-comprehensions | turtle | pickling--unpickling | working-with-binary-files-(rb,-wb) | thread-safe-data-structures-(queue.queue) | opening-files-(open()) | python-operators | lambda | writing:-write(),-writelines() | lambda-functions | python-module | list-indexing | function | frozenset | input-function | numpy | tuple-unpacking | odd-number | id-function | functional-programming | int | while-loops | tuples | zip | function-and-scope | nested-loop | format | thread-synchronization | handling-missing-values-(fillna,-dropna) | integer | immutability | identity-operator | head-and-tail | operator-overloading | introduction-to-threads | list | iterator | range | lambdas | working-with-temporary-files-using-tempfile | immutable-data-type | library | operator-and | key-value-pairs | operator-or | list-join | with-statement | pandas | iterable | numeric | higher-order-function | joining-and-merging-dataframes | identity-operators-(is,-is-not) | identity-operator | keyword | pseudocode | import-method | installation | pass | python-history | inherit | introduction-to-python | input-function | join | invalid-list | inheritance | heap-memory | identifier | introduction-to-multiprocessing | intering | zip-function | while-else-loop | random | raise | variable | working-with-dates-and-times | indexing:-loc-vs-iloc | oop | implementation | postfix | tuple | init | lambda-function | list-comprehension | parameter | virtual-environment | thread | iterators | unit-testing | object-attribute | python-django | raise-statement | tuple-methods | operator | integers | input | indentation | using-else-and-finally | python-repl | touples | print | collection | overriding-methods | parsing-with-strptime | using-map()-for-transformations | version | indexing | list-operation ...