Question 7
Back to Exercise
What is the output of the following Python program?
for i, ch in enumerate("abc", 1):
print(i, ch, end="; ")
print()
- A 0 a; 1 b; 2 c;
- B 1 a; 2 b; 3 c; Correct
- C a 1; b 2; c 3;
- D 1 abc;
Correct Answer: Option B
start=1 (here passed by position) makes the count begin at 1 instead of 0.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!