Level 9 : What is the output of this code?


x = [1, 2]
y = [1, 2]
print(x == y)
print(x is y)

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