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