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


a = [1,2,3]
b = a
print(a is b, a==b)

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