Report Bug
Qus :

What will be the output of the following Python code snippet?

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

Qus

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

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


A. a b c d
B. 0 1 2 3
C. error
D. none of the mentioned


Solution
C. error



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



Report Bug