Actually I already solved this problem but I want to solve it in another approach. I have a list [11,2,5,23,15,8,7,6,19,21,18]
and variables
pointer = 0
number = list[pointer]
I iterated it using for loop, so for each number in that loop, I added the pointer by 1. So normally the variable number
should change too right? because the pointer changed but it didn't change it still list[0]
that is 11.
do you guys know why did this happen? I believe there is something I didn't know about changing the variable