Level 1 : What will be the output of the following code?


set1 = {2,3,5}
set2 = {5,1,8}
set3 = {}
set3 = set1&set2
print(set3)

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