Level 5 : What will be the output of the following code?


set1 = {1,2,3,int('4')}
set2 = {3, str(4)}
print(set1.union(set2))

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