I have a list
a = ["a", "b", "c"]
I want to create a new list with duplicate values with suffix("_ind").
["a", "a_ind", "b", "b_ind", "c", "c_ind"]
I know it can be achieved using the following function(List with duplicated values and suffix)
def duplicate(lst):
for i in lst:
yield i
yield i + "_ind"
How the same functionality can be achieved using generator expression?. I tried with the following code, But it is not working.
duplicate = (i i+'_ind' for i in a)
File "<stdin>", line 1
duplicate = (i i+'_ind' for i in a)
^
SyntaxError: invalid syntax