Level 9 : What will be the output of the following?


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

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