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


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

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