Is there any way to remove double list? Right now I have a list inside a list as an output.
target_rule = [ '2.1.1 Context','2.1.2.4 Helping Us out','We know that']
target=[]
x=[s for s in target_rule if re.findall("\d",s)]
if x:
target.append(x)
print(target)
Output is
[['2.1.1 Context', '2.1.2.4 Helping Us out']]
But I want the output to be
['2.1.1 Context', '2.1.2.4 Helping Us out']