Level 10 : What is the output of the following code?


x = {1, 2, 3}
y = {3, 4, 5}

print(x & y)
print(x | y)
print(x - y)

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