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