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


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

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