List comprehension with only if clause -
[i for i in l if condition] #list only contains items that satisfy conditon
List comprehension with if and else -
[out1 if condition1 else out2 if i in l] #list contains out1 where the condition is met and out2 where it is not
Your problem is of the first type. You are not using the right syntax for only the if clause.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…