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