Level 5 : What is the output?


print(sum(range(1, 5)))

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