Level 1 : What will this code output?


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

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