I'm trying to iterate over a list of integers returned by a function.
Problem: i want to check if any element in the list is greater than a specific value (95), then perform a statement once, not for every iteration, i.e. go through the list, detect a number above 95 even if there are more, then perform the statement.
I've tried but the statement keep executing as many times the condition is met
here is a code i'm trying it on
for path in Path(spath).iterdir():
for n in cosine_sim(file, path):
x = all(n)
if x > 95:
print("suceess...")
the success...
prints multiple times