adplus-dvertising
frame-decoration

Question

What is the output of the following?
x = 'abcd'
for i in range(len(x)):
    print(i)

a.

a b c d

b.

0 1 2 3

c.

error

d.

1 2 3 4

Posted under Loops in Python Python

Answer: (b).0 1 2 3

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following?

Similar Questions

Discover Related MCQs