Discussion :: Python MCQs
-
What is the output of the following piece of code?a=list((45,)*4)print((45)*4)print(a)
Answer : Option C
Explanation :
(45) is an int while (45,) is a tuple of one element. Thus when a tuple is multiplied, it created references of itself which is later converted to a list.
Be The First To Comment