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