Examveda

What will be the output of the following Python code?
a= [1, 2, 3, 4, 5]
for i in range(1, 5):
    a[i-1] = a[i]
for i in range(0, 5): 
    print(a[i],end = " ")

A. 5 5 1 2 3

B. 5 1 2 3 4

C. 2 3 4 5 1

D. 2 3 4 5 5

Answer: Option D


This Question Belongs to Python Program >> Lists In Python

Join The Discussion

Related Questions on Lists in Python