Report Bug

Qus

What will be the output of the following Python function?

list(enumerate([2, 3]))

Qusनिम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?


A. Error
B. [(1, 2), (2, 3)]
C. [(0, 2), (1, 3)]
D. [(2, 3)]


Solution
C. [(0, 2), (1, 3)]



Explanation
The built-in function enumerate() accepts an iterable as an argument. The function shown in the above case returns containing pairs of the numbers given, starting from 0. Hence the output will be: [(0, 2), (1,3)].
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