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