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


data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(data[1 : : 2])

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