this is my code;
list = ["abc-123", "abc-456", "abc-789", "abc-101112"]
all_ABCs = [s for s in list if "abc" in s]
x = len(all_ABCs)
print("There are " + x + " items with 'abc' in the list")
print(all_ABCs[0])
for x in all_ABCs:
del all_ABCs[0]
print(all_ABCs[0])
This is my code with outcome;
There are 4 items with 'abc' in the list
abc-123
abc-456
abc-789
I am trying to make a loop that prints out the first item of the list every time. And when there are no more items in the list the for loop has to stop. This isn't working right now as you can see, the last abc isn't printed out.