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