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