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