Level 1 : What is the output?


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

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