Level 1 : What is the output?


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

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