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