Given a list of strings, the objective is to get the index for occurrence of 0.
To achieve this objective, the following code is propose
txt=['-100:200','-15:0','0:15','30:45']
all_t=[[int(idx) for idx in t.split(":")] for t in txt]
s_val=[]
for idx,mm in enumerate(all_t):
if 0 in mm:
s_val.append(idx)
Expected output
s_val=[1, 2]
However, I wonder the is build-in or more compact/efficient approach to achieve the above objective?