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