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