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