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