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