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