+ 5
Why i value is not increasing
I have created a code where you can swipe left or right, there are three screens black, red, green And I can't able to swipe from red(i=1) to green(i=2) As the i value remains at 1. Here's my code https://code.sololearn.com/WtGXNVEr7gVN/?ref=app line 26 you can see the increment of i
2 Respostas
+ 4
You need to declare i in the global scope.
+ 3
Thanks it works, but can you tell me the reason.
Although I declared the variable inside the function and used inside function not outside
Edit:OK now I got it, every time I calls the function it assign the value i =0, that's silly mistake😟
Thanks Rowsej 🙂