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