Level 5 : What will this print?


lst = [1, 2, 3, 4]
res = [lst[i:] + lst[:i] for i in range(len(lst))]
print(res)

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