Level 9 : What is the output?


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

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