Level 9 : What is the output?


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

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