'Merge previous item with next item if previuos item endswith \\

I need help with merging previous and next item in a list while previous item endswith '\'. Example:

my_list = ['zero_item','first\\','second\\','third\\', 'fourth', 'another_item', 'next_item', 'last_item']

Expected result:

merged_items_list = ['zero_item','first\\second\\third\\fourth', 'another_item', 'next_item', 'last_item']


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source