Level 1 : Given the following code, what will be the output?


def process_sets(s, t):
    s |= {7, 8, 9}
    t &= {2, 4, 6, 8, 10}
    return s.intersection(t), s.symmetric_difference(t)

s = {1, 2, 3, 4, 5}
t = {4, 5, 6, 7, 8, 9}
result = process_sets(s, t)

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