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