x = [1, 2, 3, 4, 5, 6, 7, 8]
for num in range(len(x)):
x[num] = x[-(num + 1)]
print(x)
Guys I want to know why the code above could not modify the list in reverse order. I am getting [8, 7, 6, 5, 5, 6, 7, 8]
when I run the code . Please kindly assist