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