Report Bug

Qus

What will be the output of the following Python code?

>>> a=(1,2)  >>> b=(3,4)  >>> c=a+b  >>> c
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. (4,6)
B. (1,2,3,4)
C. Error as tuples are immutable
D. None


Solution
B. (1,2,3,4)



Explanation
In the above piece of code, the values of the tuples aren’t being changed. Both the tuples are simply concatenated.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad