Examveda

What will be the output of the following Python code?
x = ['ab', 'cd']
for i in x:
    x.append(i.upper())
print(x)

A. ['AB', 'CD']

B. ['ab', 'cd', 'AB', 'CD']

C. ['ab', 'cd']

D. none of the mentioned

Answer: Option D


Join The Discussion

Related Questions on Conditional Formatting (While and For Loops)