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


a=165
b=sum(list(map(int,str(a))))
print(b)

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