so I have to do a Flask Machine assignment and I have a small problem with the scanner class. I created a method in which I want to add the bottle types(A B or C) to an arraylist. So I don't really know how many bottles I will enter. The thing is I want my scanning to stop once I encounter a ,,0". I know I have to use a while loop but using it like this doesn't work because by the time I want to add the bottle to the list, it jumps to the next scanned bottle.
While(input.next()!="0"){
list.add(input.next());
count++;
}