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