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