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