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