Level 1 : What will be the output of the following Python function?


sum(2,4,6)
sum([1,2,3])

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