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 | 1736+ Python FAQs | Share
return-statement | oops | type_conversion | slice | turtle | global-keyword | precedence-and-associativity | error | syntax-error | encoding | identity-operator | built-in | scientific-notation | filter | heap-memory | with-statement | built-in-function | arithmetic-operation | asyncio-module | sum() | invalid-list | matplotlib | else-statement | object-attribute | while-else-loop | loop | raise | head-and-tail | pseudocode | factorial-function | floating-point-precision | python-django | generator | bitwise-operator | conditional-statement | binary-operation | higher-order-function | python-module | inheritance | numpy | operators | comparison | methods | class | class-and-object | multiple-inheritance | default-mutable-argument | exponentiation | min-max-function | init | datetime | syntax | range | installation | gil | goto-function | condition | virtual-environment | expression | string-method | data-type | library | docstring | yield | max-min | software-design | string-slicing | built-in-function | dictionary | exception-handling | operator-overloading | generators | operand | access-modifier | dicts | sum-function | immutable-data-type | rollback | file | constructor | assert | generators-in-python | statement | counter-function | variable | command-line-parsing | mapping-function | function-and-scope | logical-operator | binary | magic-method | for | filter-function | benefit | random-function | string | class-and-instance-variable | class-and-inheritance | string-iteration | static-method | file_handling | conditional-statement | string-formatting | precedence | list-comprehension | deep-copy | list-method | method | fabs-function | while-and-for-loop | type-conversion | __all__-attribute | list-vs-tuple | control-statement | asyncio | classes | escape-operator | matrix-list-comprehension | list-indexing | pickling-&-unpickling | frozenset | identifier | collection | objects | id-function | lambda | memory | file-handling | list-mutation | parameter | postfix | call | integer | oop | odd-number | random | operations | numeric | copy | version-check | overflow | list-join | operator | swapping | global | exception | memory-management | function | __future__ | file-handling | global-variable | feature | array | loop-control | map-function | namespace | mysql | async | input | append | pep | string-slicing | print | logical-operator | keyword | iterator | slicing | zfill-function | namedtuple | dictionaries | list | inherit | datatype | loops | thread | immutability | attribute | syntax-error | python-history | version | split | mathematics | set-operation | polymorphism | zip-function | identity-operator | control-flow | string-concatenation | collections | boolean-and-non-boolean | exception-handling | nested-loop | regex | data-structure | bitwise | multiprocessing | control-flow | interpreter | comment | input-function | context-manager | touples | data-structure | input-function | list-comprehension | choice | data-type | min-function | conversion | int | tuple-unpacking | encapsulation | enumerate() | lists | tuple | typeerror | package-management | list-slicing | round | sys | while-loop | application | sorted | module | match | mathematical-function | implementation | print-statement | recursion | python_version | debugging | threading | indexing | center | def | boolean | math | update | name-mangling | logical-operation | function-argument | round-function | lambdas | global-variable | counter | basic | sys-module | error-handling | join | string-method | iterable | virtual-environment | formal-and-actual-parameter | compute | complex | indentation | math-copysign | import-method | functional-programming | recurssion | sorting | regular-expression | string-manipulation | comprehension | destructor | data_structure | complex-number | decorator | data-structures | string-formatting | python | python-repl | operator-or | expand-tab | staticmethod | lambda-function | __init_subclass__ | assignment-operator | functions | design-principle | decimal | matrix | format | operator-and | set | bitwise-operator | syntaxerror | type-conversion | zip | arithmetic-expression | descriptors | shallow-copy | pandas | stack | multithreading | list-operation | mutable ...