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


set1 = {1, 3, 5}
set2 = {2, 4, 6}
print(len(set1 + set2))

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