df=pd.read_csv('break_sent.txt', index_col=False,encoding='utf-8',delimiter="\n",names=['sent'])
#print(df[:50])
#df.index = list(df.index)
df1= df[40:50]
print(len(df))
print(df1.index)
print("-------------------------------------------")
for i,row in df1.iterrows():
string = row['sent']
#print("string",string)
d = df1[df1.sent.str.match(string)] # if the result includes more than 1 value then we know that substring and its matching parent string are present, then I will eliminate the substring from the dataframe
if len(d.index > 2):
index_val = df.index(string)
df.drop(df.index(string),inpace=True)