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