Level 1 : What is the output of the following code?


list9 = [1,2,3,4,5]
print(list9[2:4])

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