Level 1 : What does this print?


lst = [10, 20, 30, 40]
lst[:2], lst[2:] = lst[2:], lst[:2]
print(lst)

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