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