Report Bug
Qus :

What will be the output of the following Python code?

x = 'abcd'
for i in range(len(x)):
    print(i)

Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

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


Solution
B. 0 1 2 3



Explanation
i takes values 0, 1, 2 and 3.



Report Bug