When I click on the button and the last value comes up and the value ends then this error occurs, some solution
Select list item: Attempt to get item number 3 of a list of length 2:
When I click on the button and the last value comes up and the value ends then this error occurs, some solution
Select list item: Attempt to get item number 3 of a list of length 2:
Assuming the error happens in the visible blocks, the error happens because count
holds the value 3
while all
has 2 items in it. You can’t pick the 3rd item out of a list of 2 items.
Some more context might help in getting your issue resolved. What exactly are you trying to do?
Suppose there are 10 items in the list, and after I click on the button for 10th time, the items will decrease one by one, when I click for 11th time, eroor appears, I want to do that after going up to the number of items in the list, the button will automatically Visible will be false, so that this error will not occur, or this error will not occur at all.