Home » Programming Language (coding) » Python MCQ » Study the following program: x = [‘xy’, ‘yz’] for i in a: i.upper() print(a)

Study the following program: x = [‘xy’, ‘yz’] for i in a: i.upper() print(a)

Study the following program:

x = ['xy', 'yz']  
for i in a:  
    i.upper()  
print(a)  

Which of the following is correct output of this program?

A. [‘xy’, ‘yz’]
B. [‘XY’, ‘YZ’]
C. [None, None]
D. None of these

Correct Answer: Option A. [‘xy’, ‘yz’] 

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
24 + 13 =