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