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