Report Bug

Qus

What will be the output of the following Python code?

  num = ['One', 'Two', 'Three']  for i, x in enumerate(num):      print('{}: {}'.format(i, x),end=" ")
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 1: 2: 3:
B. Exception is thrown
C. One Two Three
D. 0: One 1: Two 2: Three


Solution
D. 0: One 1: Two 2: Three



Explanation
enumerate(iterator,start=0) is a built-in function which returns (0,lst[0]),(1,lst[1]) and so on where lst is a list(iterator).
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