CBSE Class 11 Informatics Practices
Question 25 of 75
Conditional and Looping Constructs — Question 7
Back to all questions['ab', 'cd']
Reason — In the given code, the for loop iterates over the list x containing strings 'ab' and 'cd'. Inside the loop, i.upper() is called, which returns a new string in uppercase but doesn't modify i itself because strings in Python are immutable. Therefore, i.upper() doesn't change i or x in place. After the loop finishes, x remains unchanged, so the output is ['ab', 'cd'].