adplus-dvertising
frame-decoration

Question

What is the output of the following?
x = ['ab', 'cd']
for i in x:
    i.upper()
print(x)

a.

[‘ab’, ‘cd’].

b.

[‘AB’, ‘CD’].

c.

[None, None].

d.

none of the mentioned

Posted under Loops in Python Python

Answer: (a).[‘ab’, ‘cd’].

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?
Tia : June 26, 2023

Why does it show in smaller letter but not in capital since upper is used

Similar Questions

Discover Related MCQs