Level 1 : What will be the output of the following Python code snippet?


for i in [1, 2, 3, 4][::-1]:
    print (i)

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