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


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

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