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