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