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