Level 1 : What is the output?


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

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