I have a mixed list of integers and strings and I need to print '**' after strings only.
data = [4, 'Fred', 'London', 34, 78, '@#=£', 89, 'Ice cream', 'Hamilton', 12, 'tingle']
[print(data, end='**') for data in data if isinstance(data, str)]
This is the output:
Fred**London**@#=£**Ice cream**Hamilton**tingle**
Desired output:
4, Fred**, London**, 34, 78, @#=£**, 89, Ice Cream**, Hamilton**, 12, tingle**