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