Level 10 : What is the output of the following code?


list1 = ['apple', 'bat', 'cat']
list2 = [1, 2, 3]

list1.extend(list2)
print(list1)

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