Iterate over the lines, and whenever there is "Alert", increment a counter. If the counter is > 1, print "skip". When Alert is not present, reset counter to 0.
counter = 0
for line in f:
if "Run" in line:
print("Vader")
counter = 0
elif "Alert" in line:
if counter > 1:
prit("skip")
counter += 1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…