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