Level 1 : What is the output?


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

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