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