I'm new to Python and start to learn using a book. I've run into this issue that the for loop is not running through all the items in the list regardless of how many items in the list.The debugging does not give much insight to it. Can someone please explain me what's happening? Thanks in advance.
sandwich_orders = ['italian','beef','chicken','tuna','cheese','pork','salami']
finished_sand = []
for sands in sandwich_orders:
temp_sand = sandwich_orders.pop()
finished_sand.append(temp_sand)
for items in finished_sand:
print(f"\nI've finished the {items} sandwich order")
print(finished_sand)
output-
I've finished the salami sandwich order
I've finished the pork sandwich order
I've finished the cheese sandwich order
I've finished the tuna sandwich order
['salami', 'pork', 'cheese', 'tuna']