Level 1 : What is the output of the following code?


x ={1,3,8}
y = {8,18,2}
z= x.intersection(y)
print(z)

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