I have a list of list which has both integers and strings inside it as their values. Now I want to convert all the values to string.
My list of list looks like : (say final_rule)
[[3, '*', 1, 4, 1], [1, 2, '*', 2, 1], ['*', '*', 3, 4, 1], [2, 2, '*', 2, 1]]
And I am trying to produce an output as:
[['3', '*', '1', '4', '1'], ['1', '2', '*', '2', '1'], ['*', '*', '3', '4', '1'], ['2', '2', '*', '2', '1']]
I am trying the below code:
new_list=[]
for list_ in final_rule:
#print("list_:",list_)
[str(i) for i in list_]
new_list.append(i)
return new_list