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