Level 1 : What will this code output?


lst = [1, 2, 3, 4]
lst[1:3] = [7, 8, 9]
print(lst)

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