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