Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 2 : 1 a-2 b-3 c-

Advertisement

Detailed Solution

सही उत्तर 1 a-2 b-3 c- है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

What does the following Python enumerate code output? / enumerate वाले निम्नलिखित Python कोड का आउटपुट क्या है? for i, ch in enumerate('abc', 1): print(i, ch, end='-')

1.
0 a-1 b-2 c-
2.
1 a-2 b-3 c-
3.
1 a 2 b 3 c
4.
a-1 b-2 c-3

Correct Answer: 1 a-2 b-3 c-

enumerate with start=1 yields (1, 'a'), (2, 'b'), (3, 'c'), printed as '1 a-2 b-3 c-'. / start=1 वाला enumerate (1, 'a'), (2, 'b'), (3, 'c') देता है, जो '1 a-2 b-3 c-' के रूप में छपता है।

Downloaded from PrepSnap (prepsnap.in)