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