Level 9 : What will this output?


lst = [1, 2, 3]
lst.clear()
lst.extend([4, 5])
print(lst)

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