Computer
What will be the output of the following python code? a= {1, 2, 3} b= {4, 5} c= a + b print (c)
Show answer
Correct answer: A) Error
In Python, the + operator is not supported for sets; sets can only be combined using methods like union() or |.The given code will raise a TypeError.
Explanation
In Python, the + operator is not supported for sets; sets can only be combined using methods like union() or |.The given code will raise a TypeError.