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