myList = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
myList[i - 1] = myList[i]
for i in range(0, 6):
print(myList[i], end = " ") how it work explai in
Answers
Answered by
0
Answer:
The output of this program will be:
1
2
3
4
5
6
0
This is because of the 1st 'for' loop you applied. The array generated in backend that contain the following data:
myLost[0] = 1
myLost[1] = 2
myLost[2] = 3
myLost[3] = 4
myLost[4] = 5
myLost[5] = 6
Thus, the output is as explained above.
Similar questions