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