I've been analyzing solutions to one problem on the Internet and stumbled upon this.
a=int(input())
array = []
for i in range (a):
b=float(input())
array+=[round(b)]
print(min(array))
if any(c>10 for c in array):
print("YES")
else:
print("NO")
I get the idea of how this code works, but can't figure out what exactly this line does.
if any(c>10 for c in array):
My basic understanding is that it checks if at least one element in the array is greater than 10. But I don't really get how it works at it's core. Like, why do you have to introduce a new variable in there? Or how does it bind this variable to the array?