Level 10 : The Output of the following code?


set1 = {10,20,40}
set2 = {40,50,60}
print(set1.union(set2))

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