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 | 1736+ Python FAQs | Share
indentation | integer | python-django | command-line-parsing | recurssion | math | static-method | lists | pep | objects | memory | call | type-conversion | global-variable | nested-loop | version | dictionary | data-structures | pickling-&-unpickling | docstring | immutability | split | update | round | choice | class-and-instance-variable | range | memory-management | int | complex-number | boolean-and-non-boolean | copy | encoding | precedence | postfix | design-principle | else-statement | virtual-environment | overflow | arithmetic-operation | keyword | destructor | tuple | join | matrix | round-function | method | inherit | oop | iterator | name-mangling | asyncio-module | polymorphism | error | counter-function | zip | assert | init | data-structure | math-copysign | tuple-unpacking | generators-in-python | formal-and-actual-parameter | string-manipulation | classes | identity-operator | logical-operation | dictionaries | virtual-environment | built-in-function | lambda-function | turtle | id-function | numeric | datetime | python-history | filter-function | expand-tab | threading | functional-programming | error-handling | string-slicing | bitwise | data_structure | list-comprehension | comprehension | python-module | operator-and | fabs-function | collection | namedtuple | thread | print-statement | syntaxerror | built-in-function | expression | rollback | zip-function | list-slicing | max-min | __init_subclass__ | arithmetic-expression | access-modifier | class-and-inheritance | mathematical-function | global-keyword | enumerate() | bitwise-operator | benefit | array | sorting | input-function | file-handling | matrix-list-comprehension | heap-memory | loop | sys | filter | function-argument | complex | binary-operation | swapping | comparison | python_version | recursion | lambda | input-function | debugging | generators | mapping-function | control-flow | gil | sys-module | list-operation | control-flow | attribute | scientific-notation | type_conversion | regular-expression | list-vs-tuple | staticmethod | global | precedence-and-associativity | logical-operator | min-function | sum-function | collections | asyncio | decorator | __all__-attribute | stack | basic | random-function | indexing | random | inheritance | loop-control | conversion | string-formatting | operators | bitwise-operator | installation | string-slicing | higher-order-function | interpreter | condition | data-type | software-design | min-max-function | loops | input | descriptors | pandas | constructor | list-method | python-repl | string-method | string-method | import-method | variable | lambdas | return-statement | operator | function | feature | data-type | compute | invalid-list | list-join | multithreading | exception-handling | list | list-indexing | global-variable | syntax-error | syntax-error | type-conversion | factorial-function | map-function | immutable-data-type | floating-point-precision | slicing | implementation | pseudocode | comment | namespace | match | data-structure | async | oops | conditional-statement | generator | string-concatenation | file | python | sorted | class | numpy | multiprocessing | multiple-inheritance | mathematics | set-operation | shallow-copy | while-and-for-loop | syntax | string-formatting | iterable | while-loop | escape-operator | operations | file_handling | logical-operator | boolean | library | append | conditional-statement | regex | while-else-loop | sum() | decimal | package-management | exception-handling | object-attribute | methods | file-handling | mysql | parameter | binary | for | slice | module | format | encapsulation | list-comprehension | control-statement | counter | __future__ | identifier | class-and-object | matplotlib | set | identity-operator | functions | yield | touples | raise | assignment-operator | function-and-scope | def | built-in | typeerror | with-statement | frozenset | odd-number | application | exception | dicts | magic-method | deep-copy | operator-overloading | print | head-and-tail | operand | default-mutable-argument | datatype | operator-or | list-mutation | version-check | zfill-function | string | center | exponentiation | mutable | goto-function | context-manager | statement | string-iteration ...