What will be the output of the following Python code? >>> a=[(2,4),(1,2),(3,9)] >>> a.sort() >>> a a) ...
View Question
Is the following Python code valid?
>>> a=(1,2,3)
>>> b=a.update(4,)
Is the following Python code valid? >>> a=(1,2,3) >>> b=a.update(4,) a) Yes, a=(1,2,3,4) and b=(1,2,3,4)
View Question
What will be the output of the following Python code?
>>> a=(2,3,1,5)
>>> a.sort()
>>> a
What will be the output of the following Python code? >>> a=(2,3,1,5) >>> a.sort() >>> a a) ...
View Question
Is the following Python code valid?
>>> a=2,3,4,5
>>> a
Is the following Python code valid? >>> a=2,3,4,5 >>> a a) Yes, 2 is printed
View QuestionTuples can’t be made keys of a dictionary.
a) true b) false Answer: b Explanation: Tuples can be made ...
View Question
What will be the output of the following Python code?
>>> import collections
>>> a=collections.namedtuple(‘a’,[‘i’,’j’])
>>> obj=a(i=4,j=7)
>>> obj
What will be the output of the following Python code? >>> import collections >>> a=collections.namedtuple('a',['i','j']) >>> obj=a(i=4,j=7) >>> ...
View Question
What will be the output of the following Python code?
>>> a,b=6,7
>>> a,b=b,a
>>> a,b
What will be the output of the following Python code? >>> a,b=6,7 >>> a,b=b,a >>> a,b a) ...
View Question
What will be the output of the following Python code?
>>> a=(1,2)
>>> b=(3,4)
>>> c=a+b
>>> c
What will be the output of the following Python code? >>> a=(1,2) >>> b=(3,4) >>> c=a+b >>> c
View Question
Is the following Python code valid?
>>> a,b=1,2,3
Is the following Python code valid? >>> a,b=1,2,3 a) Yes, this is an example ...
View Question
Is the following Python code valid?
>>> a,b,c=1,2,3
>>> a,b,c
Is the following Python code valid? >>> a,b,c=1,2,3 >>> a,b,c a) Yes, [1,2,3] is ...
View Question