Level 1 : What does this snippet do?


lst = [0, 1, 2, 3]
lst = [i for i in lst if i % 2 == 0][::-1]
print(lst)

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