Level 9 : What is the output?


lst = [10, 20, 30, 40]
print(lst[::-2])

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