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