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