It is necessary to check whether there are zeros among the given N numbers.
Input Format:
- Enter the number N, and then N numbers.
Output Format:
- Print True if there is at least one zero among the numbers entered, or False otherwise.
My decision:
print(any(int(input()) == 0 for _ in range(int(input())))) The receiving system does not want to receive it, although it works normally. It was experimentally found out that he does not want to accept because of the for loop.
How to change the program to avoid a cycle?
I tried to connect the library itertools something like this:
from itertools import chain print(any(int(input()) == 0 in chain(range(int(input()))))) But something did not work out at all.