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