Level 6 : What will be the output of the following Python code?


x = ['ab', 'cd']
print(list(map(len, x)))

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