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