Level 10 : What is the output of this code?


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

Author: bhavani | Tags: operator | 1736+ Python FAQs | Share
turtle | file-handling | stack | complex | update | pandas | random | bitwise-operator | loop | identifier | keyword | datetime | identity-operator | goto-function | counter-function | lists | nested-loop | multithreading | list-slicing | descriptors | input-function | collection | heap-memory | global-keyword | functional-programming | pep | lambda | docstring | virtual-environment | matrix | implementation | file_handling | scientific-notation | destructor | complex-number | statement | list-comprehension | built-in-function | file-handling | numeric | conversion | debugging | type_conversion | formal-and-actual-parameter | postfix | access-modifier | matrix-list-comprehension | python-django | enumerate() | error | function-argument | split | yield | threading | version | indentation | math-copysign | type-conversion | precedence | python | oop | parameter | dictionary | data-structure | mathematics | async | join | context-manager | syntaxerror | sum-function | while-and-for-loop | zip | class-and-object | global | return-statement | assignment-operator | expand-tab | string-iteration | class | odd-number | overflow | encapsulation | benefit | feature | string-formatting | string-method | sys | decimal | min-max-function | error-handling | pickling-&-unpickling | objects | random-function | method | append | list-vs-tuple | string-formatting | expression | python-repl | polymorphism | round | control-flow | id-function | version-check | command-line-parsing | classes | syntax-error | indexing | basic | functions | memory-management | file | list-mutation | data-structure | asyncio-module | encoding | multiprocessing | object-attribute | touples | function-and-scope | else-statement | sorted | design-principle | typeerror | operand | integer | input-function | string-slicing | format | slicing | center | syntax | arithmetic-expression | pseudocode | print | mapping-function | operator-overloading | lambda-function | operator-or | sum() | iterator | filter | library | operator-and | immutable-data-type | logical-operation | dicts | arithmetic-operation | comment | immutability | conditional-statement | generators-in-python | zfill-function | string-manipulation | sorting | tuple-unpacking | generators | string-method | for | loop-control | slice | bitwise-operator | import-method | zip-function | binary | default-mutable-argument | choice | list-method | operators | global-variable | floating-point-precision | exception-handling | bitwise | array | memory | precedence-and-associativity | exception-handling | string-concatenation | __all__-attribute | iterable | methods | identity-operator | module | python-history | recurssion | call | lambdas | class-and-inheritance | thread | dictionaries | decorator | int | operator | binary-operation | map-function | __future__ | syntax-error | boolean-and-non-boolean | package-management | boolean | conditional-statement | min-function | gil | comprehension | control-flow | __init_subclass__ | magic-method | virtual-environment | multiple-inheritance | filter-function | inherit | head-and-tail | data-structures | built-in-function | compute | data_structure | namedtuple | tuple | def | static-method | while-loop | with-statement | interpreter | while-else-loop | sys-module | mathematical-function | rollback | operations | control-statement | mutable | name-mangling | round-function | logical-operator | input | namespace | matplotlib | counter | exception | class-and-instance-variable | function | set | copy | condition | swapping | regular-expression | inheritance | loops | list-join | installation | print-statement | collections | application | list-comprehension | list-operation | higher-order-function | attribute | logical-operator | raise | asyncio | init | match | datatype | software-design | oops | staticmethod | range | recursion | frozenset | comparison | set-operation | variable | fabs-function | max-min | numpy | invalid-list | python_version | type-conversion | data-type | global-variable | regex | exponentiation | constructor | generator | mysql | string | shallow-copy | string-slicing | python-module | list | built-in | data-type | list-indexing | factorial-function | escape-operator | assert | math | deep-copy ...