Report Bug
Qus :

What will be the output of the following Python code?

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

Qus

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

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


A. a b c d
B. 0 1 2 3
C. error
D. 1 2 3 4


Solution
C. error



Explanation
Objects of type int have no attribute upper().



Report Bug