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