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