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